VERSION 5.00
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "ieframe.dll"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{8E27C92E-1264-101C-8A2F-040224009C02}#7.0#0"; "MSCAL.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form frmShip 
   BackColor       =   &H8000000B&
   BorderStyle     =   0  'None
   Caption         =   "FSMS Client v800.2.4.0"
   ClientHeight    =   9000
   ClientLeft      =   795
   ClientTop       =   1245
   ClientWidth     =   12000
   Icon            =   "frmShip.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   ScaleHeight     =   600
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   800
   StartUpPosition =   2  'CenterScreen
   WhatsThisButton =   -1  'True
   WhatsThisHelp   =   -1  'True
   Begin VB.Timer timerRate 
      Enabled         =   0   'False
      Interval        =   400
      Left            =   1560
      Top             =   120
   End
   Begin VB.Timer timerControl 
      Enabled         =   0   'False
      Interval        =   100
      Left            =   1440
      Top             =   120
   End
   Begin VB.Timer timerTDAutoClose 
      Interval        =   5000
      Left            =   1200
      Top             =   120
   End
   Begin VB.Timer timerDate 
      Interval        =   60000
      Left            =   1320
      Top             =   90
   End
   Begin VB.Timer timerIdle 
      Enabled         =   0   'False
      Interval        =   5000
      Left            =   1035
      Top             =   90
   End
   Begin VB.CommandButton cmdMenu 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "Rate (F11)"
      Height          =   320
      Index           =   5
      Left            =   6000
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   231
      TabStop         =   0   'False
      Top             =   8430
      UseMaskColor    =   -1  'True
      Width           =   1200
   End
   Begin VB.CommandButton cmdCustom 
      Appearance      =   0  'Flat
      BackColor       =   &H00C0E0FF&
      Caption         =   "Custom 3 (F4)"
      Height          =   320
      Index           =   3
      Left            =   10800
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   226
      TabStop         =   0   'False
      Top             =   8430
      UseMaskColor    =   -1  'True
      Width           =   1200
   End
   Begin VB.CommandButton cmdCustom 
      Appearance      =   0  'Flat
      BackColor       =   &H00C0E0FF&
      Caption         =   "Custom 2 (F3)"
      Height          =   320
      Index           =   2
      Left            =   9600
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   225
      TabStop         =   0   'False
      Top             =   8430
      UseMaskColor    =   -1  'True
      Width           =   1200
   End
   Begin VB.CommandButton cmdCustom 
      Appearance      =   0  'Flat
      BackColor       =   &H00C0E0FF&
      Caption         =   "Custom 1 (F2)"
      Height          =   320
      Index           =   1
      Left            =   8400
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   224
      TabStop         =   0   'False
      Top             =   8430
      UseMaskColor    =   -1  'True
      Width           =   1200
   End
   Begin VB.CommandButton cmdMenu 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "Close (F7)"
      Height          =   320
      Index           =   2
      Left            =   2400
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   223
      TabStop         =   0   'False
      Top             =   8430
      UseMaskColor    =   -1  'True
      Width           =   1200
   End
   Begin VB.CommandButton cmdMenu 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "Delete (F6)"
      Height          =   320
      Index           =   1
      Left            =   1200
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   222
      TabStop         =   0   'False
      Top             =   8430
      UseMaskColor    =   -1  'True
      Width           =   1200
   End
   Begin VB.CommandButton cmdMenu 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "Ref Track (F9)"
      Enabled         =   0   'False
      Height          =   320
      Index           =   4
      Left            =   4800
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   221
      TabStop         =   0   'False
      ToolTipText     =   "Track by Reference"
      Top             =   8430
      UseMaskColor    =   -1  'True
      Width           =   1200
   End
   Begin VB.CommandButton cmdMenu 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "Track (F8)"
      Enabled         =   0   'False
      Height          =   320
      Index           =   3
      Left            =   3600
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   220
      TabStop         =   0   'False
      ToolTipText     =   "Track by Tracking Number"
      Top             =   8430
      UseMaskColor    =   -1  'True
      Width           =   1200
   End
   Begin VB.CommandButton cmdMenu 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "Ship (F12)"
      Height          =   320
      Index           =   6
      Left            =   7200
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   219
      TabStop         =   0   'False
      Top             =   8430
      UseMaskColor    =   -1  'True
      Width           =   1200
   End
   Begin VB.CommandButton cmdMenu 
      Appearance      =   0  'Flat
      BackColor       =   &H00C0E0FF&
      Caption         =   "Clear (F5)"
      Height          =   320
      Index           =   0
      Left            =   0
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   218
      TabStop         =   0   'False
      Top             =   8430
      UseMaskColor    =   -1  'True
      Width           =   1200
   End
   Begin VB.Timer Timer1 
      Interval        =   500
      Left            =   45
      Top             =   90
   End
   Begin MSCommLib.MSComm MSComm1 
      Left            =   135
      Top             =   0
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DTREnable       =   -1  'True
   End
   Begin MSWinsockLib.Winsock wscFXRS 
      Left            =   450
      Top             =   90
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   255
      Left            =   0
      TabIndex        =   141
      Top             =   8745
      Width           =   12000
      _ExtentX        =   21167
      _ExtentY        =   450
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   5
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            AutoSize        =   1
            Object.Width           =   5397
            MinWidth        =   4762
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   5821
            MinWidth        =   5821
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   5821
            MinWidth        =   5821
         EndProperty
         BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   5
            Alignment       =   1
            AutoSize        =   2
            Object.Width           =   1984
            MinWidth        =   1984
            TextSave        =   "2:11 PM"
         EndProperty
         BeginProperty Panel5 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   6
            Alignment       =   1
            AutoSize        =   2
            Object.Width           =   1984
            MinWidth        =   1984
            TextSave        =   "1/6/2015"
         EndProperty
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin TabDlg.SSTab SSTab1 
      Height          =   7815
      Left            =   0
      TabIndex        =   142
      Top             =   600
      Width           =   12015
      _ExtentX        =   21193
      _ExtentY        =   13785
      _Version        =   393216
      Tabs            =   5
      Tab             =   1
      TabsPerRow      =   5
      TabHeight       =   529
      BackColor       =   -2147483638
      TabCaption(0)   =   "Ship"
      TabPicture(0)   =   "frmShip.frx":030A
      Tab(0).ControlEnabled=   0   'False
      Tab(0).Control(0)=   "fraScreens(0)"
      Tab(0).ControlCount=   1
      TabCaption(1)   =   "International"
      TabPicture(1)   =   "frmShip.frx":0326
      Tab(1).ControlEnabled=   -1  'True
      Tab(1).Control(0)=   "fraScreens(1)"
      Tab(1).Control(0).Enabled=   0   'False
      Tab(1).ControlCount=   1
      TabCaption(2)   =   "Batch"
      TabPicture(2)   =   "frmShip.frx":0342
      Tab(2).ControlEnabled=   0   'False
      Tab(2).Control(0)=   "fraScreens(2)"
      Tab(2).ControlCount=   1
      TabCaption(3)   =   "Shipping History"
      TabPicture(3)   =   "frmShip.frx":035E
      Tab(3).ControlEnabled=   0   'False
      Tab(3).Control(0)=   "fraScreens(3)"
      Tab(3).ControlCount=   1
      TabCaption(4)   =   "FedEx.com"
      TabPicture(4)   =   "frmShip.frx":037A
      Tab(4).ControlEnabled=   0   'False
      Tab(4).Control(0)=   "WebBrowser1"
      Tab(4).ControlCount=   1
      Begin VB.Frame fraScreens 
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         Caption         =   "Frame1"
         Height          =   7440
         Index           =   3
         Left            =   -74985
         TabIndex        =   286
         Top             =   300
         Width           =   11940
         Begin MSACAL.Calendar Calendar3 
            Height          =   255
            Left            =   300
            TabIndex        =   290
            TabStop         =   0   'False
            Top             =   420
            Visible         =   0   'False
            Width           =   255
            _Version        =   524288
            _ExtentX        =   450
            _ExtentY        =   450
            _StockProps     =   1
            BackColor       =   16777215
            Year            =   2004
            Month           =   2
            Day             =   9
            DayLength       =   1
            MonthLength     =   2
            DayFontColor    =   0
            FirstDay        =   1
            GridCellEffect  =   1
            GridFontColor   =   10485760
            GridLinesColor  =   -2147483632
            ShowDateSelectors=   -1  'True
            ShowDays        =   -1  'True
            ShowHorizontalGrid=   -1  'True
            ShowTitle       =   0   'False
            ShowVerticalGrid=   -1  'True
            TitleFontColor  =   10485760
            ValueIsNull     =   -1  'True
            BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "MS Sans Serif"
               Size            =   12.01
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
         End
         Begin VB.CheckBox chkAllDates 
            BackColor       =   &H00FFFFFF&
            Caption         =   "All Dates"
            Height          =   255
            Left            =   2940
            TabIndex        =   305
            Top             =   540
            Width           =   975
         End
         Begin VB.ComboBox cboLocationName 
            Height          =   315
            Index           =   1
            Left            =   4980
            TabIndex        =   294
            Top             =   495
            Width           =   2835
         End
         Begin VB.TextBox txtShipDate 
            Height          =   315
            Left            =   1380
            TabIndex        =   293
            Top             =   480
            Width           =   975
         End
         Begin VB.ComboBox cboSearchField 
            Height          =   315
            ItemData        =   "frmShip.frx":0396
            Left            =   1380
            List            =   "frmShip.frx":0398
            Style           =   2  'Dropdown List
            TabIndex        =   292
            Top             =   840
            Width           =   2475
         End
         Begin VB.TextBox txtSearchValue 
            Height          =   315
            Left            =   4980
            TabIndex        =   291
            Top             =   840
            Width           =   1755
         End
         Begin VB.CommandButton cmdSearch 
            Appearance      =   0  'Flat
            BackColor       =   &H00E0E0E0&
            Caption         =   "Search"
            Height          =   315
            Left            =   6840
            MaskColor       =   &H0080C0FF&
            Style           =   1  'Graphical
            TabIndex        =   289
            Top             =   840
            UseMaskColor    =   -1  'True
            Width           =   960
         End
         Begin VB.ComboBox cboShipmentType 
            Height          =   315
            ItemData        =   "frmShip.frx":039A
            Left            =   9360
            List            =   "frmShip.frx":03C8
            TabIndex        =   288
            Top             =   480
            Width           =   2115
         End
         Begin VB.ComboBox cboShipmentStatus 
            BackColor       =   &H00FFFFFF&
            Height          =   315
            ItemData        =   "frmShip.frx":0490
            Left            =   9360
            List            =   "frmShip.frx":049A
            TabIndex        =   287
            Top             =   840
            Width           =   2115
         End
         Begin MSDataGridLib.DataGrid grdShipments 
            Height          =   5355
            Left            =   360
            TabIndex        =   295
            ToolTipText     =   "Double-click a row to Delete a package. To Delete multiple packages, hold down CTRL, click the rows and click Delete."
            Top             =   1740
            Width           =   11175
            _ExtentX        =   19711
            _ExtentY        =   9446
            _Version        =   393216
            AllowUpdate     =   0   'False
            Enabled         =   0   'False
            HeadLines       =   2
            RowHeight       =   15
            BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ColumnCount     =   2
            BeginProperty Column00 
               DataField       =   ""
               Caption         =   ""
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column01 
               DataField       =   ""
               Caption         =   ""
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            SplitCount      =   1
            BeginProperty Split0 
               BeginProperty Column00 
               EndProperty
               BeginProperty Column01 
               EndProperty
            EndProperty
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Location:"
            Height          =   255
            Index           =   43
            Left            =   4080
            TabIndex        =   303
            Top             =   540
            Width           =   795
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Ship Date:"
            Height          =   255
            Index           =   44
            Left            =   420
            TabIndex        =   302
            Top             =   540
            Width           =   855
         End
         Begin VB.Image Image4 
            Height          =   345
            Left            =   2460
            Picture         =   "frmShip.frx":04B0
            Stretch         =   -1  'True
            Top             =   480
            Width           =   345
         End
         Begin VB.Label lblShipmentsView 
            BackColor       =   &H00FFFFFF&
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H000080FF&
            Height          =   255
            Left            =   360
            TabIndex        =   301
            Top             =   1320
            Width           =   6015
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   19
            X1              =   360
            X2              =   11520
            Y1              =   1620
            Y2              =   1620
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   18
            X1              =   360
            X2              =   11520
            Y1              =   120
            Y2              =   120
         End
         Begin VB.Label Label53 
            BackColor       =   &H00FFFFFF&
            Caption         =   "View Parameters"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H000080FF&
            Height          =   255
            Left            =   360
            TabIndex        =   300
            Top             =   135
            Width           =   2775
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Search:"
            Height          =   255
            Index           =   45
            Left            =   420
            TabIndex        =   299
            Top             =   900
            Width           =   855
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Value:"
            Height          =   255
            Index           =   46
            Left            =   4020
            TabIndex        =   298
            Top             =   900
            Width           =   855
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Shipment Type:"
            Height          =   255
            Index           =   34
            Left            =   8040
            TabIndex        =   297
            Top             =   540
            Width           =   1215
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Shipment Status:"
            Height          =   255
            Index           =   37
            Left            =   7980
            TabIndex        =   296
            Top             =   900
            Width           =   1275
         End
      End
      Begin VB.Frame fraScreens 
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         Caption         =   "Frame1"
         Height          =   7440
         Index           =   2
         Left            =   -74985
         TabIndex        =   143
         Top             =   315
         Width           =   11940
         Begin VB.CheckBox chkAddrVerifyBatch 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Addr Verify"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   3300
            TabIndex        =   263
            Top             =   1860
            Width           =   1395
         End
         Begin VB.CheckBox chkBatchErrorCheck 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Check for Errors"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   1440
            TabIndex        =   137
            Top             =   1860
            Width           =   1755
         End
         Begin VB.ComboBox cboBatchProfile 
            Height          =   315
            Left            =   1440
            TabIndex        =   132
            Top             =   480
            Width           =   3255
         End
         Begin VB.CommandButton cmdBrowse 
            BackColor       =   &H00E0E0E0&
            Caption         =   "..."
            BeginProperty Font 
               Name            =   "Arial Black"
               Size            =   8.25
               Charset         =   0
               Weight          =   900
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   4800
            Style           =   1  'Graphical
            TabIndex        =   134
            ToolTipText     =   "Click to select the batch file."
            Top             =   960
            Width           =   375
         End
         Begin VB.ListBox lstErrorTransactions 
            Height          =   4545
            Left            =   360
            TabIndex        =   217
            TabStop         =   0   'False
            ToolTipText     =   "Double-click a line to process on Ship screen."
            Top             =   2580
            Width           =   11175
         End
         Begin VB.CommandButton cmdShipAll 
            Appearance      =   0  'Flat
            BackColor       =   &H00C0E0FF&
            Caption         =   "&Ship All"
            Height          =   285
            Left            =   1440
            MaskColor       =   &H0080C0FF&
            Style           =   1  'Graphical
            TabIndex        =   135
            Top             =   1440
            UseMaskColor    =   -1  'True
            Width           =   1485
         End
         Begin VB.TextBox txtBatchFilename 
            Height          =   315
            Left            =   1440
            TabIndex        =   133
            Top             =   960
            Width           =   3255
         End
         Begin VB.CommandButton cmdAbortBatch 
            Appearance      =   0  'Flat
            BackColor       =   &H00E0E0E0&
            Caption         =   "&Pause/Abort"
            Height          =   285
            Left            =   3180
            MaskColor       =   &H00E0E0E0&
            Style           =   1  'Graphical
            TabIndex        =   136
            Top             =   1440
            Width           =   1485
         End
         Begin VB.TextBox txtTotalRecords 
            Height          =   315
            Left            =   8880
            Locked          =   -1  'True
            TabIndex        =   138
            TabStop         =   0   'False
            Top             =   480
            Width           =   855
         End
         Begin VB.TextBox txtNumShipped 
            Height          =   315
            Left            =   8880
            Locked          =   -1  'True
            TabIndex        =   139
            TabStop         =   0   'False
            Top             =   840
            Width           =   855
         End
         Begin VB.TextBox txtNumErrors 
            Height          =   315
            Left            =   8880
            Locked          =   -1  'True
            TabIndex        =   140
            TabStop         =   0   'False
            Top             =   1200
            Width           =   855
         End
         Begin MSComDlg.CommonDialog cdlBatchFilename 
            Left            =   240
            Top             =   6720
            _ExtentX        =   847
            _ExtentY        =   847
            _Version        =   393216
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Profile:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   47
            Left            =   480
            TabIndex        =   234
            Top             =   540
            Width           =   855
         End
         Begin VB.Label Label38 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Batch Shipment Details"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H000080FF&
            Height          =   255
            Index           =   0
            Left            =   6360
            TabIndex        =   150
            Top             =   135
            Width           =   2775
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   21
            X1              =   6360
            X2              =   11520
            Y1              =   120
            Y2              =   120
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   22
            X1              =   6000
            X2              =   6000
            Y1              =   300
            Y2              =   1680
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   20
            X1              =   360
            X2              =   5580
            Y1              =   120
            Y2              =   120
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   13
            X1              =   360
            X2              =   11520
            Y1              =   2220
            Y2              =   2220
         End
         Begin VB.Label Label62 
            BackColor       =   &H00FFFFFF&
            Caption         =   "File Information"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H000080FF&
            Height          =   255
            Index           =   0
            Left            =   360
            TabIndex        =   149
            Top             =   135
            Width           =   2055
         End
         Begin VB.Label Label63 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Error Transactions"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H000080FF&
            Height          =   255
            Index           =   0
            Left            =   360
            TabIndex        =   148
            Top             =   2235
            Width           =   2055
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Filename:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   17
            Left            =   480
            TabIndex        =   147
            Top             =   1020
            Width           =   855
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Number Shipped:"
            Height          =   255
            Index           =   24
            Left            =   7080
            TabIndex        =   146
            Top             =   900
            Width           =   1695
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Total Records:"
            Height          =   255
            Index           =   18
            Left            =   7200
            TabIndex        =   145
            Top             =   540
            Width           =   1575
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Number of Errors:"
            Height          =   255
            Index           =   25
            Left            =   7080
            TabIndex        =   144
            Top             =   1260
            Width           =   1695
         End
      End
      Begin VB.Frame fraScreens 
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         Height          =   7440
         Index           =   1
         Left            =   15
         TabIndex        =   151
         Top             =   315
         Width           =   11940
         Begin VB.OptionButton opt1358 
            BackColor       =   &H00FFFFFF&
            Caption         =   "FTR Exemption"
            Height          =   315
            Index           =   0
            Left            =   7440
            TabIndex        =   119
            Top             =   2280
            Width           =   1455
         End
         Begin VB.CheckBox f413 
            BackColor       =   &H00FFFFFF&
            Caption         =   "NAFTA Applies"
            Height          =   255
            Left            =   2400
            TabIndex        =   261
            Top             =   1560
            Width           =   1395
         End
         Begin VB.CheckBox chkB13A 
            BackColor       =   &H00FFFFFF&
            Caption         =   "B13A Required"
            Height          =   315
            Left            =   8160
            TabIndex        =   123
            Top             =   3000
            Width           =   2715
         End
         Begin VB.CommandButton cmdViewCommodities 
            Appearance      =   0  'Flat
            BackColor       =   &H00E0E0E0&
            Caption         =   "View/Edit"
            Height          =   255
            Left            =   10440
            MaskColor       =   &H0080C0FF&
            Style           =   1  'Graphical
            TabIndex        =   116
            Top             =   480
            UseMaskColor    =   -1  'True
            Width           =   960
         End
         Begin VB.TextBox txtTotCommodWgt 
            Alignment       =   1  'Right Justify
            Height          =   315
            Left            =   8160
            Locked          =   -1  'True
            TabIndex        =   118
            TabStop         =   0   'False
            Top             =   1200
            Width           =   1275
         End
         Begin VB.TextBox txtTotCustVal 
            Alignment       =   1  'Right Justify
            Height          =   315
            Left            =   8160
            Locked          =   -1  'True
            TabIndex        =   117
            TabStop         =   0   'False
            Top             =   840
            Width           =   1275
         End
         Begin VB.TextBox txtCommodCount 
            Alignment       =   1  'Right Justify
            Height          =   315
            Left            =   8160
            Locked          =   -1  'True
            TabIndex        =   115
            TabStop         =   0   'False
            Top             =   480
            Width           =   1275
         End
         Begin VB.CheckBox f73 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Parties Related"
            Height          =   255
            Left            =   2400
            TabIndex        =   98
            Top             =   1260
            Width           =   3015
         End
         Begin VB.Frame fraCommodity 
            BackColor       =   &H00FFFFFF&
            BorderStyle     =   0  'None
            Caption         =   "Frame2"
            Height          =   4695
            Left            =   240
            TabIndex        =   201
            Top             =   2280
            Width           =   5415
            Begin VB.TextBox f120 
               Height          =   315
               Left            =   2160
               TabIndex        =   111
               Top             =   3960
               Width           =   2175
            End
            Begin MSACAL.Calendar Calendar2 
               Height          =   255
               Left            =   4920
               TabIndex        =   211
               TabStop         =   0   'False
               Top             =   1800
               Visible         =   0   'False
               Width           =   255
               _Version        =   524288
               _ExtentX        =   450
               _ExtentY        =   450
               _StockProps     =   1
               BackColor       =   16777215
               Year            =   2004
               Month           =   2
               Day             =   9
               DayLength       =   1
               MonthLength     =   2
               DayFontColor    =   0
               FirstDay        =   1
               GridCellEffect  =   1
               GridFontColor   =   10485760
               GridLinesColor  =   -2147483632
               ShowDateSelectors=   -1  'True
               ShowDays        =   -1  'True
               ShowHorizontalGrid=   -1  'True
               ShowTitle       =   0   'False
               ShowVerticalGrid=   -1  'True
               TitleFontColor  =   10485760
               ValueIsNull     =   -1  'True
               BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Arial"
                  Size            =   12.01
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
            End
            Begin VB.TextBox f1275 
               Height          =   315
               Left            =   2160
               TabIndex        =   110
               Top             =   3600
               Width           =   2175
            End
            Begin VB.ComboBox f1090 
               Height          =   315
               ItemData        =   "frmShip.frx":07BA
               Left            =   4560
               List            =   "frmShip.frx":07C1
               TabIndex        =   105
               Text            =   "USD"
               Top             =   2160
               Width           =   735
            End
            Begin VB.TextBox f78 
               Height          =   315
               Left            =   2160
               TabIndex        =   104
               Top             =   2160
               Width           =   2175
            End
            Begin VB.TextBox f1030 
               Height          =   315
               Left            =   2160
               TabIndex        =   103
               Top             =   1800
               Width           =   2175
            End
            Begin VB.TextBox txtCommodityWgt 
               Height          =   315
               Left            =   4560
               TabIndex        =   107
               Top             =   2520
               Width           =   735
            End
            Begin VB.ComboBox cboCommodityID 
               Height          =   315
               Left            =   2160
               TabIndex        =   99
               Text            =   "cboCommodityID"
               Top             =   0
               Width           =   3135
            End
            Begin VB.TextBox f79 
               Height          =   1035
               Left            =   2160
               MultiLine       =   -1  'True
               TabIndex        =   100
               Top             =   360
               Width           =   3135
            End
            Begin VB.TextBox f82 
               Height          =   315
               Left            =   2160
               TabIndex        =   101
               Top             =   1440
               Width           =   855
            End
            Begin VB.ComboBox f414 
               Height          =   315
               Left            =   3360
               TabIndex        =   102
               Top             =   1440
               Width           =   1935
            End
            Begin VB.TextBox f77 
               Height          =   315
               Left            =   2160
               TabIndex        =   106
               Top             =   2520
               Width           =   855
            End
            Begin VB.ComboBox f80 
               Height          =   315
               Index           =   0
               Left            =   2160
               TabIndex        =   108
               Top             =   2880
               Width           =   2175
            End
            Begin VB.TextBox f81 
               Height          =   315
               Left            =   2160
               TabIndex        =   109
               Top             =   3240
               Width           =   2175
            End
            Begin VB.CommandButton cmdAddToShipment 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "&Add to Shipment"
               Height          =   315
               Left            =   3840
               MaskColor       =   &H00E0E0E0&
               Style           =   1  'Graphical
               TabIndex        =   114
               Top             =   4320
               Width           =   1455
            End
            Begin VB.TextBox f84 
               Height          =   315
               Left            =   4200
               TabIndex        =   113
               Top             =   3600
               Width           =   1095
            End
            Begin VB.TextBox f83 
               Height          =   315
               Left            =   4200
               TabIndex        =   112
               Top             =   3120
               Width           =   1095
            End
            Begin VB.Label lblMoreCommodity 
               Alignment       =   2  'Center
               BackColor       =   &H00FFFFFF&
               Caption         =   "More Commodity"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   -1  'True
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H000080FF&
               Height          =   195
               Left            =   360
               TabIndex        =   328
               Top             =   4440
               Width           =   1695
            End
            Begin VB.Label lblCommodity 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Marks and Numbers:"
               Height          =   255
               Index           =   14
               Left            =   360
               TabIndex        =   312
               Top             =   4020
               Width           =   1695
            End
            Begin VB.Label lblCommodity 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Part Number:"
               Height          =   255
               Index           =   11
               Left            =   360
               TabIndex        =   241
               Top             =   3660
               Width           =   1695
            End
            Begin VB.Label lblCommodity 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Wgt Each:"
               Height          =   255
               Index           =   8
               Left            =   3480
               TabIndex        =   216
               Top             =   2580
               Width           =   975
            End
            Begin VB.Label lblCommodity 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Commodity ID:"
               Height          =   255
               Index           =   1
               Left            =   600
               TabIndex        =   210
               Top             =   60
               Width           =   1455
            End
            Begin VB.Label lblCommodity 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Description:"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   2
               Left            =   480
               TabIndex        =   209
               Top             =   420
               Width           =   1575
            End
            Begin VB.Label lblCommodity 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Quantity and UOM:"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   3
               Left            =   240
               TabIndex        =   208
               Top             =   1440
               Width           =   1815
            End
            Begin VB.Label lblCommodity 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Unit Value:"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   5
               Left            =   600
               TabIndex        =   207
               Top             =   1860
               Width           =   1455
            End
            Begin VB.Label lblCommodity 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Customs Value:"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   6
               Left            =   120
               TabIndex        =   206
               Top             =   2220
               Width           =   1935
            End
            Begin VB.Label lblCommodity 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Commodity Wgt:"
               Height          =   255
               Index           =   7
               Left            =   120
               TabIndex        =   205
               Top             =   2580
               Width           =   1935
            End
            Begin VB.Label lblCommodity 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Country of Manu:"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   9
               Left            =   360
               TabIndex        =   204
               Top             =   2940
               Width           =   1695
            End
            Begin VB.Label lblCommodity 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Harmonized Code:"
               Height          =   255
               Index           =   10
               Left            =   360
               TabIndex        =   203
               Top             =   3300
               Width           =   1695
            End
            Begin VB.Label lblCommodity 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Export License, Expiry:"
               Height          =   255
               Index           =   12
               Left            =   3480
               TabIndex        =   202
               Top             =   2880
               Width           =   1860
            End
            Begin VB.Image Image3 
               Height          =   345
               Left            =   4980
               Picture         =   "frmShip.frx":07CA
               Stretch         =   -1  'True
               Top             =   3915
               Width           =   345
            End
         End
         Begin VB.Frame fraCI 
            BackColor       =   &H00FFFFFF&
            BorderStyle     =   0  'None
            Caption         =   "Frame2"
            Height          =   2475
            Left            =   6360
            TabIndex        =   191
            Top             =   3720
            Width           =   5055
            Begin VB.TextBox f418 
               Height          =   315
               Index           =   3
               Left            =   1800
               TabIndex        =   131
               Top             =   2160
               Width           =   3255
            End
            Begin VB.TextBox f418 
               Height          =   315
               Index           =   2
               Left            =   1800
               TabIndex        =   130
               Top             =   1800
               Width           =   3255
            End
            Begin VB.ComboBox f1357 
               Height          =   315
               ItemData        =   "frmShip.frx":0AD4
               Left            =   3120
               List            =   "frmShip.frx":0AEA
               TabIndex        =   128
               Top             =   1080
               Width           =   1935
            End
            Begin VB.ComboBox f72 
               Height          =   315
               ItemData        =   "frmShip.frx":0B5B
               Left            =   1800
               List            =   "frmShip.frx":0B71
               TabIndex        =   124
               Top             =   0
               Width           =   3255
            End
            Begin VB.TextBox f418 
               Height          =   315
               Index           =   1
               Left            =   1800
               TabIndex        =   129
               Top             =   1440
               Width           =   3255
            End
            Begin VB.TextBox f532 
               Height          =   315
               Left            =   1800
               TabIndex        =   125
               Top             =   360
               Width           =   1215
            End
            Begin VB.TextBox f533 
               Height          =   315
               Left            =   1800
               TabIndex        =   126
               Top             =   720
               Width           =   1215
            End
            Begin VB.TextBox f534 
               Height          =   315
               Left            =   1800
               TabIndex        =   127
               Top             =   1080
               Width           =   1215
            End
            Begin VB.Label lblCI 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Comment 3:"
               Height          =   255
               Index           =   6
               Left            =   120
               TabIndex        =   198
               Top             =   2220
               Width           =   1575
            End
            Begin VB.Label lblCI 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Comment 2:"
               Height          =   255
               Index           =   5
               Left            =   120
               TabIndex        =   197
               Top             =   1860
               Width           =   1575
            End
            Begin VB.Label lblCI 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Terms of Sale:"
               Height          =   255
               Index           =   0
               Left            =   240
               TabIndex        =   196
               Top             =   60
               Width           =   1455
            End
            Begin VB.Label lblCI 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Comment 1:"
               Height          =   255
               Index           =   4
               Left            =   120
               TabIndex        =   195
               Top             =   1500
               Width           =   1575
            End
            Begin VB.Label lblCI 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Freight Charge:"
               Height          =   255
               Index           =   1
               Left            =   240
               TabIndex        =   194
               Top             =   420
               Width           =   1455
            End
            Begin VB.Label lblCI 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Insurance Charge:"
               Height          =   255
               Index           =   2
               Left            =   -120
               TabIndex        =   193
               Top             =   780
               Width           =   1815
            End
            Begin VB.Label lblCI 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Misc. Charge:"
               Height          =   255
               Index           =   3
               Left            =   -120
               TabIndex        =   192
               Top             =   1140
               Width           =   1815
            End
         End
         Begin VB.Frame fraCommod 
            BackColor       =   &H00FFFFFF&
            BorderStyle     =   0  'None
            Caption         =   "Frame2"
            Height          =   1155
            Left            =   360
            TabIndex        =   227
            Top             =   30
            Width           =   5415
            Begin VB.TextBox f71 
               Height          =   315
               Left            =   2040
               TabIndex        =   95
               Top             =   840
               Width           =   3135
            End
            Begin VB.ComboBox f70 
               Height          =   315
               ItemData        =   "frmShip.frx":0C57
               Left            =   2040
               List            =   "frmShip.frx":0C64
               TabIndex        =   94
               Top             =   480
               Width           =   3135
            End
            Begin VB.Label lblf20 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Duty/Tax Account #:"
               Height          =   255
               Index           =   1
               Left            =   360
               TabIndex        =   230
               Top             =   900
               Width           =   1575
            End
            Begin VB.Label Label1 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Duty/Tax Pay Type:"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   23
               Left            =   0
               TabIndex        =   229
               Top             =   540
               Width           =   1935
            End
            Begin VB.Line Line1 
               BorderColor     =   &H000080FF&
               BorderWidth     =   2
               Index           =   6
               X1              =   0
               X2              =   5220
               Y1              =   90
               Y2              =   90
            End
            Begin VB.Label Label46 
               BackColor       =   &H00FFFFFF&
               Caption         =   "International Commodities"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H000080FF&
               Height          =   255
               Left            =   0
               TabIndex        =   228
               Top             =   105
               Width           =   2775
            End
         End
         Begin VB.Frame fraDocs 
            BackColor       =   &H00FFFFFF&
            BorderStyle     =   0  'None
            Caption         =   "Frame3"
            Height          =   1155
            Left            =   360
            TabIndex        =   212
            Top             =   30
            Width           =   5415
            Begin VB.ComboBox f79Doc 
               Height          =   315
               Left            =   2040
               TabIndex        =   96
               Top             =   480
               Width           =   3135
            End
            Begin VB.ComboBox f80 
               Height          =   315
               Index           =   1
               Left            =   2040
               TabIndex        =   97
               Top             =   840
               Width           =   3135
            End
            Begin VB.Label Label1 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Document Type:"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   16
               Left            =   240
               TabIndex        =   215
               Top             =   540
               Width           =   1695
            End
            Begin VB.Label lbl80 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Country of Manu:"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Left            =   240
               TabIndex        =   213
               Top             =   900
               Width           =   1695
            End
            Begin VB.Line Line1 
               BorderColor     =   &H000080FF&
               BorderWidth     =   2
               Index           =   12
               X1              =   0
               X2              =   5040
               Y1              =   90
               Y2              =   90
            End
            Begin VB.Label Label27 
               BackColor       =   &H00FFFFFF&
               Caption         =   "International Documents"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H000080FF&
               Height          =   255
               Left            =   0
               TabIndex        =   214
               Top             =   105
               Width           =   2775
            End
         End
         Begin VB.OptionButton opt1358 
            BackColor       =   &H00FFFFFF&
            Caption         =   "AES Citation"
            Height          =   315
            Index           =   1
            Left            =   9060
            TabIndex        =   121
            Top             =   2280
            Width           =   1455
         End
         Begin VB.TextBox f1358 
            Height          =   315
            Left            =   8160
            TabIndex        =   122
            Top             =   2640
            Width           =   3255
         End
         Begin VB.ComboBox cbo1358 
            Height          =   315
            ItemData        =   "frmShip.frx":0CA4
            Left            =   8160
            List            =   "frmShip.frx":0CA6
            TabIndex        =   120
            Top             =   2640
            Width           =   3255
         End
         Begin VB.Label lbl1358 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Exemption Type:"
            Height          =   255
            Left            =   6360
            TabIndex        =   262
            Top             =   2700
            Width           =   1695
         End
         Begin VB.Label lblCommodSummary 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Total Commodity Wgt:"
            Height          =   255
            Index           =   2
            Left            =   6420
            TabIndex        =   260
            Top             =   1260
            Width           =   1635
         End
         Begin VB.Label lblCommodSummary 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Total Customs Value:"
            Height          =   255
            Index           =   1
            Left            =   6540
            TabIndex        =   259
            Top             =   900
            Width           =   1515
         End
         Begin VB.Label lblCommodSummary 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Commodity Count:"
            Height          =   255
            Index           =   0
            Left            =   6540
            TabIndex        =   258
            Top             =   540
            Width           =   1515
         End
         Begin VB.Label Label81 
            BackColor       =   &H00FFFFFF&
            Caption         =   "SED/EEI Information"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H000080FF&
            Height          =   255
            Left            =   6360
            TabIndex        =   200
            Top             =   1935
            Width           =   2775
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   9
            X1              =   6360
            X2              =   11520
            Y1              =   1920
            Y2              =   1920
         End
         Begin VB.Label Label76 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Commodity Summary"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H000080FF&
            Height          =   255
            Left            =   6360
            TabIndex        =   199
            Top             =   135
            Width           =   2775
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   8
            X1              =   6360
            X2              =   11520
            Y1              =   120
            Y2              =   120
         End
         Begin VB.Label Label47 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Define Commodities"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H000080FF&
            Height          =   255
            Left            =   360
            TabIndex        =   153
            Top             =   1935
            Width           =   2055
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   7
            X1              =   360
            X2              =   5580
            Y1              =   1920
            Y2              =   1920
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   11
            X1              =   6000
            X2              =   6000
            Y1              =   300
            Y2              =   7080
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   10
            X1              =   6360
            X2              =   11520
            Y1              =   3360
            Y2              =   3360
         End
         Begin VB.Label Label26 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Commercial Invoice"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H000080FF&
            Height          =   255
            Left            =   6360
            TabIndex        =   152
            Top             =   3375
            Width           =   2775
         End
      End
      Begin VB.Frame fraScreens 
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         Caption         =   "Frame1"
         Height          =   7440
         Index           =   0
         Left            =   -74985
         TabIndex        =   154
         Top             =   300
         Width           =   11940
         Begin MSACAL.Calendar Calendar4 
            Height          =   255
            Left            =   11160
            TabIndex        =   236
            TabStop         =   0   'False
            Top             =   2640
            Visible         =   0   'False
            Width           =   255
            _Version        =   524288
            _ExtentX        =   450
            _ExtentY        =   450
            _StockProps     =   1
            BackColor       =   16777215
            Year            =   2004
            Month           =   2
            Day             =   9
            DayLength       =   1
            MonthLength     =   2
            DayFontColor    =   0
            FirstDay        =   1
            GridCellEffect  =   1
            GridFontColor   =   10485760
            GridLinesColor  =   -2147483632
            ShowDateSelectors=   -1  'True
            ShowDays        =   -1  'True
            ShowHorizontalGrid=   -1  'True
            ShowTitle       =   0   'False
            ShowVerticalGrid=   -1  'True
            TitleFontColor  =   10485760
            ValueIsNull     =   -1  'True
            BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   12.01
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
         End
         Begin MSACAL.Calendar Calendar1 
            Height          =   255
            Left            =   9360
            TabIndex        =   176
            TabStop         =   0   'False
            Top             =   2640
            Visible         =   0   'False
            Width           =   255
            _Version        =   524288
            _ExtentX        =   450
            _ExtentY        =   450
            _StockProps     =   1
            BackColor       =   16777215
            Year            =   2004
            Month           =   2
            Day             =   9
            DayLength       =   1
            MonthLength     =   2
            DayFontColor    =   0
            FirstDay        =   1
            GridCellEffect  =   1
            GridFontColor   =   10485760
            GridLinesColor  =   -2147483632
            ShowDateSelectors=   -1  'True
            ShowDays        =   -1  'True
            ShowHorizontalGrid=   -1  'True
            ShowTitle       =   0   'False
            ShowVerticalGrid=   -1  'True
            TitleFontColor  =   10485760
            ValueIsNull     =   -1  'True
            BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "MS Sans Serif"
               Size            =   12.01
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
         End
         Begin VB.ComboBox f15 
            Height          =   315
            Left            =   1800
            TabIndex        =   11
            Top             =   3015
            Width           =   3750
         End
         Begin VB.CommandButton cmdAddressBook 
            Appearance      =   0  'Flat
            BackColor       =   &H00E0E0E0&
            Caption         =   "Address Book"
            Height          =   330
            Left            =   4410
            MaskColor       =   &H0080C0FF&
            Style           =   1  'Graphical
            TabIndex        =   313
            ToolTipText     =   "Choose recipient from Addresses"
            Top             =   450
            UseMaskColor    =   -1  'True
            Width           =   1110
         End
         Begin VB.ComboBox f1355 
            Height          =   315
            Left            =   1800
            TabIndex        =   21
            Top             =   6900
            Width           =   3135
         End
         Begin VB.CheckBox chkAddAddress 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Add To Address Book"
            Height          =   255
            Left            =   3720
            TabIndex        =   13
            Top             =   3420
            Value           =   1  'Checked
            Visible         =   0   'False
            Width           =   1875
         End
         Begin VB.TextBox txtDelDate 
            Height          =   315
            Left            =   9900
            TabIndex        =   39
            Top             =   2640
            Visible         =   0   'False
            Width           =   975
         End
         Begin VB.ComboBox cboLocationName 
            Height          =   315
            Index           =   0
            Left            =   1800
            TabIndex        =   20
            Top             =   6540
            Width           =   3135
         End
         Begin VB.CheckBox chkEmailAlert 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Email Alerts"
            Height          =   255
            Left            =   3720
            TabIndex        =   15
            Top             =   3720
            Width           =   1215
         End
         Begin VB.CommandButton cmdMPS 
            Appearance      =   0  'Flat
            BackColor       =   &H00E0E0E0&
            Caption         =   "&Multi-Piece"
            Enabled         =   0   'False
            Height          =   315
            Left            =   10485
            MaskColor       =   &H0080C0FF&
            Style           =   1  'Graphical
            TabIndex        =   30
            Top             =   1170
            UseMaskColor    =   -1  'True
            Width           =   960
         End
         Begin VB.Frame frameIntl 
            BackColor       =   &H00FFFFFF&
            BorderStyle     =   0  'None
            Caption         =   "Frame1"
            Height          =   375
            Left            =   6345
            TabIndex        =   189
            Top             =   360
            Width           =   5250
            Begin VB.CheckBox f1482 
               BackColor       =   &H00FFFFFF&
               Caption         =   "TD"
               Height          =   315
               Left            =   3420
               TabIndex        =   24
               Top             =   45
               Width           =   615
            End
            Begin VB.CommandButton cmdViewTD 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Left            =   4140
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   25
               Top             =   60
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.OptionButton optCommodities 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Commodities"
               Height          =   255
               Left            =   1680
               TabIndex        =   23
               Top             =   120
               Width           =   1215
            End
            Begin VB.OptionButton optDocument 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Document"
               Height          =   255
               Left            =   45
               TabIndex        =   22
               Top             =   90
               Width           =   1215
            End
         End
         Begin VB.ComboBox f68 
            Height          =   315
            ItemData        =   "frmShip.frx":0CA8
            Left            =   9240
            List            =   "frmShip.frx":0CAF
            TabIndex        =   41
            Text            =   "USD"
            Top             =   3000
            Width           =   765
         End
         Begin VB.CheckBox chkDuplicate 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Identical Pkgs"
            Height          =   255
            Left            =   9000
            TabIndex        =   27
            Top             =   840
            Width           =   1335
         End
         Begin VB.ComboBox f23 
            Height          =   315
            ItemData        =   "frmShip.frx":0CB8
            Left            =   8160
            List            =   "frmShip.frx":0CC5
            TabIndex        =   42
            Top             =   3360
            Width           =   3315
         End
         Begin VB.ComboBox f1274 
            Height          =   315
            ItemData        =   "frmShip.frx":0D05
            Left            =   8160
            List            =   "frmShip.frx":0D07
            TabIndex        =   31
            Top             =   1560
            Width           =   3315
         End
         Begin VB.TextBox f20 
            Height          =   315
            Left            =   8160
            TabIndex        =   43
            Top             =   3720
            Width           =   2115
         End
         Begin VB.TextBox f26 
            Height          =   315
            Left            =   8160
            TabIndex        =   40
            Top             =   3000
            Width           =   975
         End
         Begin VB.TextBox f24 
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   315
            Left            =   8160
            TabIndex        =   38
            Top             =   2640
            Width           =   975
         End
         Begin VB.TextBox f1670 
            Height          =   315
            Left            =   8160
            TabIndex        =   28
            Top             =   1200
            Width           =   735
         End
         Begin VB.TextBox f116 
            Height          =   315
            Left            =   8160
            TabIndex        =   26
            Text            =   "1"
            Top             =   840
            Width           =   735
         End
         Begin VB.ComboBox f75 
            Height          =   315
            ItemData        =   "frmShip.frx":0D09
            Left            =   9000
            List            =   "frmShip.frx":0D10
            Style           =   2  'Dropdown List
            TabIndex        =   29
            Top             =   1200
            Width           =   735
         End
         Begin VB.TextBox f57 
            Height          =   315
            Left            =   9360
            TabIndex        =   36
            ToolTipText     =   "Height"
            Top             =   2280
            Width           =   375
         End
         Begin VB.TextBox f58 
            Height          =   315
            Left            =   8760
            TabIndex        =   35
            ToolTipText     =   "Width"
            Top             =   2280
            Width           =   375
         End
         Begin VB.TextBox f59 
            Height          =   315
            Left            =   8160
            TabIndex        =   34
            ToolTipText     =   "Length"
            Top             =   2280
            Width           =   375
         End
         Begin VB.ComboBox f16 
            Height          =   315
            Left            =   3540
            TabIndex        =   10
            Top             =   2640
            Width           =   1995
         End
         Begin VB.TextBox f25 
            Height          =   315
            Left            =   1800
            TabIndex        =   16
            Top             =   4620
            Width           =   3735
         End
         Begin VB.TextBox f13 
            Height          =   315
            Left            =   1800
            TabIndex        =   7
            Top             =   1920
            Width           =   3735
         End
         Begin VB.TextBox f14 
            Height          =   315
            Left            =   1800
            TabIndex        =   8
            Top             =   2280
            Width           =   3735
         End
         Begin VB.TextBox f17 
            BackColor       =   &H00FFFFFF&
            Height          =   315
            Left            =   1800
            TabIndex        =   9
            Top             =   2640
            Width           =   1065
         End
         Begin VB.TextBox f18 
            Height          =   315
            Left            =   1800
            TabIndex        =   12
            Top             =   3375
            Width           =   1755
         End
         Begin VB.CheckBox f440 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Residential address"
            Height          =   255
            Left            =   1800
            TabIndex        =   14
            Top             =   3720
            Width           =   1695
         End
         Begin VB.TextBox f3056 
            Height          =   315
            Left            =   1800
            TabIndex        =   17
            Top             =   4980
            Width           =   3735
         End
         Begin VB.TextBox f3057 
            Height          =   315
            Left            =   1800
            TabIndex        =   18
            Top             =   5340
            Width           =   3735
         End
         Begin VB.ComboBox cboBoxName 
            Height          =   315
            Left            =   9900
            TabIndex        =   37
            Top             =   2280
            Visible         =   0   'False
            Width           =   1575
         End
         Begin VB.ComboBox f38 
            Height          =   315
            Left            =   1800
            TabIndex        =   19
            Top             =   5700
            Width           =   3735
         End
         Begin VB.ComboBox f1958 
            Height          =   315
            Left            =   9900
            TabIndex        =   33
            ToolTipText     =   "Please select Admissibility Pkg Type"
            Top             =   1920
            Width           =   1575
         End
         Begin VB.ComboBox f50 
            Height          =   315
            Left            =   1800
            TabIndex        =   2
            Top             =   840
            Width           =   3735
         End
         Begin VB.TextBox f11 
            Height          =   315
            Left            =   1800
            TabIndex        =   5
            Top             =   1560
            Width           =   3735
         End
         Begin VB.ComboBox cboCompany 
            Height          =   315
            Left            =   1800
            TabIndex        =   6
            Top             =   1560
            Visible         =   0   'False
            Width           =   3735
         End
         Begin VB.ComboBox f1273 
            Height          =   315
            Left            =   8160
            TabIndex        =   32
            Top             =   1920
            Width           =   3315
         End
         Begin VB.TextBox f1 
            Height          =   315
            Left            =   1800
            TabIndex        =   0
            ToolTipText     =   "Ctrl-A to AddressBook"
            Top             =   480
            Width           =   2430
         End
         Begin VB.ComboBox cboCustID 
            Height          =   315
            Left            =   1800
            TabIndex        =   1
            ToolTipText     =   "Ctrl-A to order entry"
            Top             =   480
            Visible         =   0   'False
            Width           =   2430
         End
         Begin VB.TextBox f12 
            BackColor       =   &H00FFFFFF&
            Height          =   315
            Left            =   1800
            TabIndex        =   3
            Top             =   1200
            Width           =   3735
         End
         Begin VB.ComboBox cboContact 
            Height          =   315
            Left            =   1800
            TabIndex        =   4
            Top             =   1200
            Visible         =   0   'False
            Width           =   3735
         End
         Begin VB.Frame fraSpecial 
            BackColor       =   &H00FFFFFF&
            BorderStyle     =   0  'None
            Height          =   2805
            Index           =   6
            Left            =   6960
            TabIndex        =   239
            Top             =   4560
            Width           =   4635
            Begin VB.CheckBox f2382 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Return Labels"
               Height          =   255
               Index           =   4
               Left            =   90
               TabIndex        =   325
               Top             =   2100
               Width           =   2175
            End
            Begin VB.CommandButton cmdViewReturnLbl 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   4
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   324
               Top             =   2100
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox chkETD 
               BackColor       =   &H00FFFFFF&
               Caption         =   "ETD"
               Height          =   285
               Index           =   1
               Left            =   90
               TabIndex        =   322
               Top             =   1800
               Width           =   2415
            End
            Begin VB.CommandButton cmdViewETD 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   1
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   321
               Top             =   1800
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CommandButton cmdViewDG 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   3
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   317
               Top             =   1500
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f1331 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Dangerous Goods"
               Height          =   255
               Index           =   4
               Left            =   90
               TabIndex        =   316
               Top             =   1500
               Width           =   2175
            End
            Begin VB.CheckBox f1266 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Saturday Delivery"
               Height          =   285
               Index           =   2
               Left            =   90
               TabIndex        =   285
               Top             =   1200
               Width           =   2415
            End
            Begin VB.CheckBox chkIntlIPD 
               BackColor       =   &H00FFFFFF&
               Caption         =   "IPD"
               Height          =   255
               Left            =   90
               TabIndex        =   265
               Top             =   900
               Width           =   795
            End
            Begin VB.CommandButton cmdViewIntlIPD 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   264
               Top             =   900
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CommandButton cmdViewBSO 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   1
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   86
               Top             =   600
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f1174 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Broker Select"
               Height          =   285
               Index           =   1
               Left            =   90
               TabIndex        =   85
               Top             =   600
               Width           =   2415
            End
            Begin VB.CheckBox f1200 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Hold at Location"
               Height          =   285
               Index           =   3
               Left            =   90
               TabIndex        =   83
               Top             =   300
               Width           =   2415
            End
            Begin VB.CheckBox f1268 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Dry Ice"
               Height          =   285
               Index           =   3
               Left            =   90
               TabIndex        =   81
               Top             =   0
               Width           =   2415
            End
            Begin VB.CommandButton cmdViewHAL 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   3
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   84
               Top             =   300
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CommandButton cmdViewDryIce 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   3
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   82
               Top             =   0
               UseMaskColor    =   -1  'True
               Width           =   960
            End
         End
         Begin VB.Frame fraSpecial 
            BackColor       =   &H00FFFFFF&
            BorderStyle     =   0  'None
            Height          =   2805
            Index           =   5
            Left            =   6960
            TabIndex        =   240
            Top             =   4560
            Width           =   4635
            Begin VB.CommandButton cmdViewDG 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   1
               Left            =   3555
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   315
               Top             =   1200
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f1331 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Dangerous Goods"
               Height          =   255
               Index           =   3
               Left            =   135
               TabIndex        =   314
               Top             =   1200
               Width           =   2175
            End
            Begin VB.CommandButton cmdViewReturnLbl 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   3
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   284
               Top             =   1500
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f2382 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Return Labels"
               Height          =   255
               Index           =   3
               Left            =   120
               TabIndex        =   283
               Top             =   1500
               Width           =   2175
            End
            Begin VB.TextBox f1118 
               Height          =   285
               Left            =   3540
               TabIndex        =   282
               Top             =   885
               Width           =   960
            End
            Begin VB.CheckBox f51 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Deliver Without Signature"
               Height          =   285
               Left            =   120
               TabIndex        =   281
               Top             =   900
               Width           =   2415
            End
            Begin VB.CommandButton cmdViewDryIce 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   2
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   77
               Top             =   0
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CommandButton cmdViewHAL 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   2
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   79
               Top             =   300
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f1268 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Dry Ice"
               Height          =   285
               Index           =   2
               Left            =   120
               TabIndex        =   76
               Top             =   0
               Width           =   2415
            End
            Begin VB.CheckBox f1200 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Hold at Location"
               Height          =   285
               Index           =   2
               Left            =   120
               TabIndex        =   78
               Top             =   300
               Width           =   2415
            End
            Begin VB.CheckBox f1266 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Saturday Delivery"
               Height          =   285
               Index           =   1
               Left            =   120
               TabIndex        =   80
               Top             =   600
               Width           =   2415
            End
         End
         Begin VB.Frame fraSpecial 
            BackColor       =   &H00FFFFFF&
            BorderStyle     =   0  'None
            Height          =   2805
            Index           =   3
            Left            =   6960
            TabIndex        =   190
            Top             =   4560
            Width           =   4575
            Begin VB.CheckBox f1331 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Dangerous Goods"
               Height          =   255
               Index           =   2
               Left            =   120
               TabIndex        =   257
               Top             =   1200
               Width           =   2175
            End
            Begin VB.CommandButton cmdViewDG 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   2
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   256
               Top             =   1200
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CommandButton cmdViewIPD 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   75
               Top             =   1500
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox chkIPD 
               BackColor       =   &H00FFFFFF&
               Caption         =   "IPD"
               Height          =   195
               Left            =   120
               TabIndex        =   74
               Top             =   1500
               Width           =   795
            End
            Begin VB.CommandButton cmdViewBSO 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   0
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   73
               Top             =   900
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f1174 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Broker Select"
               Height          =   285
               Index           =   0
               Left            =   120
               TabIndex        =   72
               Top             =   900
               Width           =   2415
            End
            Begin VB.CheckBox f1332 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Alcohol"
               Height          =   285
               Index           =   1
               Left            =   120
               TabIndex        =   66
               Top             =   0
               Width           =   2415
            End
            Begin VB.CheckBox f1200 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Hold at Location"
               Height          =   285
               Index           =   1
               Left            =   120
               TabIndex        =   70
               Top             =   600
               Width           =   2415
            End
            Begin VB.CheckBox f1268 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Dry Ice"
               Height          =   285
               Index           =   1
               Left            =   120
               TabIndex        =   68
               Top             =   300
               Width           =   2415
            End
            Begin VB.CommandButton cmdViewHAL 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   1
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   71
               Top             =   600
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CommandButton cmdViewDryIce 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   1
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   69
               Top             =   300
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CommandButton cmdViewAlcohol 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   1
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   67
               Top             =   0
               UseMaskColor    =   -1  'True
               Width           =   960
            End
         End
         Begin VB.Frame fraSpecial 
            BackColor       =   &H00FFFFFF&
            BorderStyle     =   0  'None
            Height          =   2805
            Index           =   7
            Left            =   6420
            TabIndex        =   242
            Top             =   4560
            Width           =   5115
            Begin VB.ComboBox cboEndorsement 
               Height          =   315
               ItemData        =   "frmShip.frx":0D19
               Left            =   1740
               List            =   "frmShip.frx":0D2C
               TabIndex        =   92
               Top             =   780
               Width           =   3315
            End
            Begin VB.CheckBox chkNoDelConfirm 
               BackColor       =   &H00FFFFFF&
               Caption         =   "No Delivery Confirmation"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Left            =   1740
               TabIndex        =   93
               Top             =   1140
               Visible         =   0   'False
               Width           =   2535
            End
            Begin VB.ComboBox cboSubClass 
               Height          =   315
               ItemData        =   "frmShip.frx":0DD2
               Left            =   1740
               List            =   "frmShip.frx":0DD4
               TabIndex        =   91
               Top             =   420
               Width           =   3315
            End
            Begin VB.ComboBox cboClass 
               Height          =   315
               ItemData        =   "frmShip.frx":0DD6
               Left            =   1740
               List            =   "frmShip.frx":0DD8
               TabIndex        =   90
               Top             =   60
               Width           =   3315
            End
            Begin VB.Label Label1 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Endorsement:"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   10
               Left            =   0
               TabIndex        =   306
               Top             =   0
               Visible         =   0   'False
               Width           =   1455
            End
            Begin VB.Label Label1 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Sub-class:"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   48
               Left            =   720
               TabIndex        =   244
               Top             =   480
               Width           =   915
            End
            Begin VB.Label Label1 
               Alignment       =   1  'Right Justify
               BackColor       =   &H00FFFFFF&
               Caption         =   "Class:"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   41
               Left            =   840
               TabIndex        =   243
               Top             =   120
               Width           =   795
            End
         End
         Begin VB.Frame fraSpecial 
            BackColor       =   &H00FFFFFF&
            BorderStyle     =   0  'None
            Height          =   2805
            Index           =   0
            Left            =   6960
            TabIndex        =   157
            Top             =   4560
            Width           =   4575
            Begin VB.CommandButton cmdViewPA 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   311
               Top             =   2400
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f1209 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Priority Alert"
               Height          =   255
               Left            =   120
               TabIndex        =   310
               Top             =   2400
               Width           =   2175
            End
            Begin VB.CommandButton cmdViewDG 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   0
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   254
               Top             =   2100
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f1331 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Dangerous Goods"
               Height          =   255
               Index           =   0
               Left            =   120
               TabIndex        =   253
               Top             =   2100
               Width           =   2175
            End
            Begin VB.CommandButton cmdViewReturnLbl 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   0
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   246
               Top             =   1800
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CommandButton cmdViewSigReq 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   0
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   245
               Top             =   1500
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f1208 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Signature Service"
               Height          =   285
               Index           =   0
               Left            =   120
               TabIndex        =   53
               Top             =   1500
               Width           =   2175
            End
            Begin VB.CheckBox f2382 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Return Labels"
               Height          =   255
               Index           =   0
               Left            =   120
               TabIndex        =   54
               Top             =   1800
               Width           =   2175
            End
            Begin VB.CommandButton cmdViewAlcohol 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   0
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   45
               Top             =   0
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CommandButton cmdViewDryIce 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   0
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   49
               Top             =   600
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CommandButton cmdViewCOD 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   0
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   47
               Top             =   300
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CommandButton cmdViewHAL 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   0
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   51
               Top             =   900
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f27 
               BackColor       =   &H00FFFFFF&
               Caption         =   "COD (Collect on Delivery)"
               Height          =   285
               Index           =   0
               Left            =   120
               TabIndex        =   46
               Top             =   300
               Width           =   2415
            End
            Begin VB.CheckBox f1268 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Dry Ice"
               Height          =   285
               Index           =   0
               Left            =   120
               TabIndex        =   48
               Top             =   600
               Width           =   2415
            End
            Begin VB.CheckBox f1200 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Hold at Location"
               Height          =   285
               Index           =   0
               Left            =   120
               TabIndex        =   50
               Top             =   900
               Width           =   2415
            End
            Begin VB.CheckBox f1332 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Alcohol"
               Height          =   285
               Index           =   0
               Left            =   120
               TabIndex        =   44
               Top             =   0
               Width           =   2415
            End
            Begin VB.CheckBox f1266 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Saturday Delivery"
               Height          =   285
               Index           =   0
               Left            =   120
               TabIndex        =   52
               Top             =   1200
               Width           =   2415
            End
         End
         Begin VB.Frame fraSpecial 
            BackColor       =   &H00FFFFFF&
            BorderStyle     =   0  'None
            Height          =   2805
            Index           =   2
            Left            =   6960
            TabIndex        =   156
            Top             =   4560
            Width           =   4695
            Begin VB.CommandButton cmdViewSigReq 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   1
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   250
               Top             =   1200
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f1208 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Signature Service"
               Height          =   285
               Index           =   1
               Left            =   120
               TabIndex        =   249
               Top             =   1200
               Width           =   2175
            End
            Begin VB.CommandButton cmdViewReturnLbl 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   2
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   247
               Top             =   1500
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f2382 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Return Labels"
               Height          =   255
               Index           =   2
               Left            =   120
               TabIndex        =   61
               Top             =   1500
               Width           =   2175
            End
            Begin VB.CheckBox f3018 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Non-Standard Packaging"
               Height          =   285
               Index           =   1
               Left            =   120
               TabIndex        =   55
               Top             =   0
               Width           =   2415
            End
            Begin VB.CommandButton cmdDateCertain 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   57
               Top             =   300
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f3020 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Evening Delivery"
               Height          =   285
               Index           =   1
               Left            =   120
               TabIndex        =   58
               Top             =   600
               Width           =   2415
            End
            Begin VB.CommandButton cmdApptDel 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   60
               Top             =   900
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f3020 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Date Certain Delivery"
               Height          =   285
               Index           =   0
               Left            =   120
               TabIndex        =   56
               Top             =   300
               Width           =   2415
            End
            Begin VB.CheckBox f3020 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Appointment Delivery"
               Height          =   285
               Index           =   2
               Left            =   120
               TabIndex        =   59
               Top             =   900
               Width           =   2415
            End
         End
         Begin VB.Frame fraSpecial 
            BackColor       =   &H00FFFFFF&
            BorderStyle     =   0  'None
            Height          =   2805
            Index           =   8
            Left            =   6960
            TabIndex        =   266
            Top             =   4440
            Width           =   4575
            Begin VB.CheckBox f1121 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Inside Delivery"
               Height          =   255
               Left            =   2700
               TabIndex        =   308
               Top             =   1920
               Width           =   1515
            End
            Begin VB.CheckBox f1120 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Inside Pickup"
               Height          =   255
               Left            =   120
               TabIndex        =   307
               Top             =   1920
               Width           =   2175
            End
            Begin VB.CommandButton cmdViewCOD 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   3
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   279
               Top             =   2220
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f27 
               BackColor       =   &H00FFFFFF&
               Caption         =   "COD (Collect on Delivery)"
               Height          =   285
               Index           =   3
               Left            =   120
               TabIndex        =   278
               Top             =   2220
               Width           =   2415
            End
            Begin VB.CheckBox f6110 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Food"
               Height          =   255
               Index           =   8
               Left            =   2700
               TabIndex        =   277
               Top             =   420
               Width           =   2055
            End
            Begin VB.CheckBox f6110 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Poison"
               Height          =   285
               Index           =   6
               Left            =   120
               TabIndex        =   276
               Top             =   1620
               Width           =   2055
            End
            Begin VB.CheckBox f6110 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Residential Pickup"
               Height          =   255
               Index           =   7
               Left            =   2700
               TabIndex        =   275
               Top             =   120
               Width           =   1695
            End
            Begin VB.CheckBox f6110 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Freezable Protection"
               Height          =   285
               Index           =   2
               Left            =   120
               TabIndex        =   274
               Top             =   420
               Width           =   2055
            End
            Begin VB.CheckBox f6110 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Limited Access Pickup"
               Height          =   285
               Index           =   3
               Left            =   120
               TabIndex        =   273
               Top             =   720
               Width           =   2055
            End
            Begin VB.CheckBox f6110 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Limited Access Delivery"
               Height          =   285
               Index           =   4
               Left            =   120
               TabIndex        =   272
               Top             =   1020
               Width           =   2055
            End
            Begin VB.CheckBox f6110 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Call Before Delivery"
               Height          =   285
               Index           =   1
               Left            =   120
               TabIndex        =   271
               Top             =   120
               Width           =   2055
            End
            Begin VB.CheckBox f6110 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Guaranteed Plus"
               Height          =   285
               Index           =   5
               Left            =   120
               TabIndex        =   270
               Top             =   1320
               Width           =   2055
            End
            Begin VB.CheckBox f6110 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Single Shipment"
               Height          =   255
               Index           =   9
               Left            =   2700
               TabIndex        =   269
               Top             =   720
               Width           =   2055
            End
            Begin VB.CheckBox f6110 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Do Not Stack Pallets"
               Height          =   255
               Index           =   10
               Left            =   2700
               TabIndex        =   268
               Top             =   1020
               Width           =   2055
            End
            Begin VB.CheckBox f6110 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Lift Gate Required"
               Height          =   255
               Index           =   11
               Left            =   2700
               TabIndex        =   267
               Top             =   1320
               Width           =   2055
            End
            Begin VB.Label lblMoreLTL 
               Alignment       =   2  'Center
               BackColor       =   &H00FFFFFF&
               Caption         =   "More LTL"
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   -1  'True
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H000080FF&
               Height          =   195
               Left            =   1800
               TabIndex        =   280
               Top             =   2520
               Width           =   975
            End
         End
         Begin VB.Frame fraSpecial 
            BackColor       =   &H00FFFFFF&
            BorderStyle     =   0  'None
            Caption         =   "cmdSigReq"
            Height          =   2805
            Index           =   1
            Left            =   7020
            TabIndex        =   155
            Top             =   4560
            Width           =   4695
            Begin VB.CommandButton cmdViewHazMat 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Left            =   3480
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   309
               Top             =   1200
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f1331 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Hazardous Materials"
               Height          =   255
               Index           =   1
               Left            =   60
               TabIndex        =   255
               Top             =   1200
               Width           =   2175
            End
            Begin VB.CommandButton cmdViewSigReq 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   2
               Left            =   3480
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   252
               Top             =   600
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f1208 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Signature Service"
               Height          =   285
               Index           =   2
               Left            =   60
               TabIndex        =   251
               Top             =   600
               Width           =   2175
            End
            Begin VB.CommandButton cmdViewReturnLbl 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   1
               Left            =   3480
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   248
               Top             =   900
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox f2382 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Return Labels"
               Height          =   255
               Index           =   1
               Left            =   60
               TabIndex        =   65
               Top             =   900
               Width           =   2175
            End
            Begin VB.CheckBox f3018 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Non-Standard Packaging"
               Height          =   285
               Index           =   0
               Left            =   60
               TabIndex        =   62
               Top             =   0
               Width           =   2415
            End
            Begin VB.CheckBox f27 
               BackColor       =   &H00FFFFFF&
               Caption         =   "COD (Collect on Delivery)"
               Height          =   285
               Index           =   2
               Left            =   60
               TabIndex        =   63
               Top             =   300
               Width           =   2415
            End
            Begin VB.CommandButton cmdViewCOD 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   1
               Left            =   3480
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   64
               Top             =   300
               UseMaskColor    =   -1  'True
               Width           =   960
            End
         End
         Begin VB.Frame fraSpecial 
            BackColor       =   &H00FFFFFF&
            BorderStyle     =   0  'None
            Height          =   2805
            Index           =   4
            Left            =   6930
            TabIndex        =   238
            Top             =   4560
            Width           =   4755
            Begin VB.CheckBox f2382 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Return Labels"
               Height          =   255
               Index           =   5
               Left            =   120
               TabIndex        =   327
               Top             =   960
               Width           =   2175
            End
            Begin VB.CommandButton cmdViewReturnLbl 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   5
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   326
               Top             =   960
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CommandButton cmdViewETD 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   0
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   320
               Top             =   600
               UseMaskColor    =   -1  'True
               Width           =   960
            End
            Begin VB.CheckBox chkETD 
               BackColor       =   &H00FFFFFF&
               Caption         =   "ETD"
               Height          =   285
               Index           =   0
               Left            =   120
               TabIndex        =   319
               Top             =   600
               Width           =   2415
            End
            Begin VB.CheckBox f3018 
               BackColor       =   &H00FFFFFF&
               Caption         =   "Non-Standard Packaging"
               Height          =   285
               Index           =   2
               Left            =   120
               TabIndex        =   87
               Top             =   0
               Width           =   2415
            End
            Begin VB.CheckBox f27 
               BackColor       =   &H00FFFFFF&
               Caption         =   "COD (Collect on Delivery)"
               Height          =   285
               Index           =   1
               Left            =   120
               TabIndex        =   88
               Top             =   300
               Width           =   2415
            End
            Begin VB.CommandButton cmdViewCOD 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               Caption         =   "View/Edit"
               Height          =   255
               Index           =   2
               Left            =   3540
               MaskColor       =   &H0080C0FF&
               Style           =   1  'Graphical
               TabIndex        =   89
               Top             =   300
               UseMaskColor    =   -1  'True
               Width           =   960
            End
         End
         Begin VB.Label f1222 
            Height          =   135
            Left            =   -50
            TabIndex        =   323
            Top             =   0
            Visible         =   0   'False
            Width           =   50
         End
         Begin VB.Image Image1 
            Height          =   345
            Left            =   10980
            Picture         =   "frmShip.frx":0DDA
            Stretch         =   -1  'True
            Top             =   2640
            Visible         =   0   'False
            Width           =   345
         End
         Begin VB.Label lbl1355 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Current IOR Facility:"
            Height          =   255
            Left            =   120
            TabIndex        =   237
            Top             =   6960
            Width           =   1575
         End
         Begin VB.Label lblLocationName 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Current Location:"
            Height          =   255
            Left            =   240
            TabIndex        =   233
            Top             =   6600
            Width           =   1455
         End
         Begin VB.Label Label29 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Shipper Account"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H000080FF&
            Height          =   255
            Left            =   360
            TabIndex        =   232
            Top             =   6255
            Width           =   2055
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   4
            X1              =   360
            X2              =   5580
            Y1              =   6240
            Y2              =   6240
         End
         Begin VB.Label Label73 
            Alignment       =   2  'Center
            BackColor       =   &H00FFFFFF&
            Caption         =   "x"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   9.75
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   0
            Left            =   9120
            TabIndex        =   188
            Top             =   2310
            Width           =   255
         End
         Begin VB.Label Label24 
            Alignment       =   2  'Center
            BackColor       =   &H00FFFFFF&
            Caption         =   "x"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   9.75
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   0
            Left            =   8520
            TabIndex        =   187
            Top             =   2310
            Width           =   255
         End
         Begin VB.Image Image2 
            Height          =   345
            Left            =   9240
            Picture         =   "frmShip.frx":10E4
            Stretch         =   -1  'True
            Top             =   2640
            Width           =   345
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Bill Shipment to:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   19
            Left            =   6600
            TabIndex        =   186
            Top             =   3420
            Width           =   1455
         End
         Begin VB.Label lblDecVal 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Declared Value:"
            Height          =   255
            Left            =   6060
            TabIndex        =   185
            Top             =   3060
            Width           =   1995
         End
         Begin VB.Label lblShipDate 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Ship Date:"
            Height          =   255
            Left            =   6300
            TabIndex        =   184
            Top             =   2700
            Width           =   1755
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Package Dimensions:"
            Height          =   255
            Index           =   9
            Left            =   6480
            TabIndex        =   183
            Top             =   2340
            Width           =   1575
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Service Type:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   21
            Left            =   6600
            TabIndex        =   182
            Top             =   1620
            Width           =   1455
         End
         Begin VB.Label lblWeight 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Package Weight:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   6480
            TabIndex        =   181
            Top             =   1260
            Width           =   1575
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Number of Pkgs:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   22
            Left            =   6540
            TabIndex        =   180
            Top             =   900
            Width           =   1515
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Package Type:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   20
            Left            =   6600
            TabIndex        =   179
            Top             =   1980
            Width           =   1455
         End
         Begin VB.Label lblDIMs 
            BackColor       =   &H00FFFFFF&
            Caption         =   "L x W x H in."
            ForeColor       =   &H000080FF&
            Height          =   255
            Left            =   9900
            TabIndex        =   178
            Top             =   2340
            Width           =   1215
         End
         Begin VB.Label lblf20 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Bill-to Account #:"
            Height          =   255
            Index           =   0
            Left            =   6480
            TabIndex        =   177
            Top             =   3780
            Width           =   1575
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Country:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   2
            Left            =   240
            TabIndex        =   175
            Top             =   900
            Width           =   1455
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Address 2:"
            Height          =   255
            Index           =   5
            Left            =   240
            TabIndex        =   174
            Top             =   2340
            Width           =   1455
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   5
            X1              =   6000
            X2              =   6000
            Y1              =   300
            Y2              =   7080
         End
         Begin VB.Label Label12 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Package and Shipment Details"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H000080FF&
            Height          =   255
            Left            =   6360
            TabIndex        =   172
            Top             =   135
            Width           =   2775
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   1
            X1              =   6360
            X2              =   11520
            Y1              =   120
            Y2              =   120
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Reference:"
            Height          =   255
            Index           =   11
            Left            =   240
            TabIndex        =   171
            Top             =   4680
            Width           =   1455
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Department:"
            Height          =   255
            Index           =   14
            Left            =   240
            TabIndex        =   170
            Top             =   5760
            Width           =   1455
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Contact Name:"
            Height          =   255
            Index           =   0
            Left            =   240
            TabIndex        =   169
            Top             =   1260
            Width           =   1455
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Company Name:"
            Height          =   255
            Index           =   3
            Left            =   240
            TabIndex        =   168
            Top             =   1620
            Width           =   1455
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Address 1:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   4
            Left            =   240
            TabIndex        =   167
            Top             =   1980
            Width           =   1455
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "City:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   6
            Left            =   240
            TabIndex        =   166
            Top             =   3060
            Width           =   1455
         End
         Begin VB.Label lblState 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "State:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   2880
            TabIndex        =   165
            Top             =   2655
            Width           =   615
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Zip:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   7
            Left            =   1305
            TabIndex        =   164
            Top             =   2655
            Width           =   375
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Telephone:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   8
            Left            =   360
            TabIndex        =   163
            Top             =   3420
            Width           =   1335
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   0
            X1              =   360
            X2              =   5580
            Y1              =   120
            Y2              =   120
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   2
            X1              =   360
            X2              =   5580
            Y1              =   4260
            Y2              =   4260
         End
         Begin VB.Label Label9 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Recipient Information"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H000080FF&
            Height          =   255
            Left            =   360
            TabIndex        =   162
            Top             =   135
            Width           =   2055
         End
         Begin VB.Label Label10 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Reference Information"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H000080FF&
            Height          =   255
            Left            =   360
            TabIndex        =   161
            Top             =   4275
            Width           =   2055
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Invoice Number:"
            Height          =   255
            Index           =   13
            Left            =   240
            TabIndex        =   160
            Top             =   5400
            Width           =   1455
         End
         Begin VB.Label lblPONumber 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "P.O. Number:"
            Height          =   255
            Left            =   240
            TabIndex        =   159
            Top             =   5040
            Width           =   1455
         End
         Begin VB.Label Label11 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Special Services"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H000080FF&
            Height          =   255
            Left            =   6360
            TabIndex        =   158
            Top             =   4275
            Width           =   2055
         End
         Begin VB.Line Line1 
            BorderColor     =   &H000080FF&
            BorderWidth     =   2
            Index           =   3
            X1              =   6360
            X2              =   11520
            Y1              =   4260
            Y2              =   4260
         End
         Begin VB.Label Label1 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            Caption         =   "Order ID:"
            Height          =   255
            Index           =   1
            Left            =   240
            TabIndex        =   173
            ToolTipText     =   "Ctrl-A/double-click to AddressBook"
            Top             =   540
            Width           =   1455
         End
      End
      Begin SHDocVwCtl.WebBrowser WebBrowser1 
         Height          =   7335
         Left            =   -74880
         TabIndex        =   304
         Top             =   380
         Width           =   11775
         ExtentX         =   20770
         ExtentY         =   12938
         ViewMode        =   0
         Offline         =   0
         Silent          =   0
         RegisterAsBrowser=   0
         RegisterAsDropTarget=   1
         AutoArrange     =   0   'False
         NoClientEdge    =   0   'False
         AlignLeft       =   0   'False
         NoWebView       =   0   'False
         HideFileNames   =   0   'False
         SingleClick     =   0   'False
         SingleSelection =   0   'False
         NoFolders       =   0   'False
         Transparent     =   0   'False
         ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
         Location        =   ""
      End
   End
   Begin VB.CommandButton cmdMenu 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "ReLabel"
      Height          =   320
      Index           =   7
      Left            =   7200
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   318
      TabStop         =   0   'False
      Top             =   8430
      UseMaskColor    =   -1  'True
      Width           =   1200
   End
   Begin VB.Label lblMessage 
      Alignment       =   2  'Center
      BackColor       =   &H8000000A&
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2460
      TabIndex        =   235
      Top             =   0
      Width           =   7035
   End
   Begin VB.Image imgLogo1 
      Height          =   630
      Left            =   9960
      Picture         =   "frmShip.frx":13EE
      Top             =   -30
      Width           =   2010
   End
   Begin VB.Image imgLogo2 
      Height          =   630
      Left            =   9960
      Picture         =   "frmShip.frx":190F
      Top             =   -30
      Width           =   2010
   End
   Begin VB.Image imgLogo3 
      Height          =   630
      Left            =   9960
      Picture         =   "frmShip.frx":1E30
      Top             =   -30
      Width           =   2010
   End
   Begin VB.Image imgLogo4 
      Height          =   630
      Left            =   9960
      Picture         =   "frmShip.frx":2351
      Top             =   -30
      Width           =   2010
   End
   Begin VB.Menu mnuFile 
      Caption         =   "&File"
      NegotiatePosition=   2  'Middle
      Begin VB.Menu mnuImport 
         Caption         =   "Import"
         Begin VB.Menu mnuAddressBook 
            Caption         =   "Address Book"
         End
         Begin VB.Menu mnuAltReturnAddr 
            Caption         =   "Alternate Return Addresses"
         End
         Begin VB.Menu mnuDIMs 
            Caption         =   "Box Dimensions"
         End
         Begin VB.Menu mnuCommodities 
            Caption         =   "Commodities"
         End
         Begin VB.Menu mnuDepartments 
            Caption         =   "Departments"
         End
         Begin VB.Menu mnuLTLItems 
            Caption         =   "LTL Items"
         End
         Begin VB.Menu mnu1 
            Caption         =   "-"
         End
         Begin VB.Menu mnuSPZipToZone 
            Caption         =   "SmartPost Zip-to-Zone"
         End
         Begin VB.Menu mnuSPStdARates 
            Caption         =   "SmartPost Std A Rates"
         End
         Begin VB.Menu mnuSPStdBRates 
            Caption         =   "SmartPost Std B Rates"
         End
         Begin VB.Menu mnuSPPMRates 
            Caption         =   "Smart Post Priority Mail Rates"
         End
         Begin VB.Menu mnu2 
            Caption         =   "-"
         End
         Begin VB.Menu mnuMigrate720 
            Caption         =   "Migrate 720 Database"
         End
      End
      Begin VB.Menu mnuAddEditDelete 
         Caption         =   "Add/Edit/Delete"
         Begin VB.Menu mnuAddressBookEdit 
            Caption         =   "Address Book"
         End
         Begin VB.Menu mnuAltReturnAddrEdit 
            Caption         =   "Alternate Return Addresses"
         End
         Begin VB.Menu mnuDIMsEdit 
            Caption         =   "Box Dimensions"
         End
         Begin VB.Menu mnuCommoditiesEdit 
            Caption         =   "Commodities"
         End
         Begin VB.Menu mnuDeptEdit 
            Caption         =   "Departments"
         End
         Begin VB.Menu mnuLTLItemsEdit 
            Caption         =   "LTL Line Items"
         End
         Begin VB.Menu mnuManufacturerEdit 
            Caption         =   "Manufacturer"
            Visible         =   0   'False
         End
      End
      Begin VB.Menu mnuSPFTP 
         Caption         =   "Send FTP File(s)"
      End
      Begin VB.Menu mnuPurge 
         Caption         =   "Purge"
      End
      Begin VB.Menu mnuLblReprint 
         Caption         =   "Label Reprint"
         Shortcut        =   ^L
      End
   End
   Begin VB.Menu mnuSetup 
      Caption         =   "&Setup"
   End
   Begin VB.Menu mnuConnect 
      Caption         =   "&Connect"
   End
   Begin VB.Menu mnuPreAssign 
      Caption         =   "&Pre-Assign"
   End
   Begin VB.Menu mnuVerifyAddress 
      Caption         =   "&Verify Address "
      Begin VB.Menu mnuAutoVerify 
         Caption         =   "Auto Verify"
         Shortcut        =   ^E
      End
      Begin VB.Menu mnuShowVerifyForm 
         Caption         =   "Show Verification Form"
         Shortcut        =   ^F
      End
   End
   Begin VB.Menu mnuQuote 
      Caption         =   "Service &Quote"
   End
   Begin VB.Menu mnuTags 
      Caption         =   "Call &Tag/Express Tag"
   End
   Begin VB.Menu mnuExit 
      Caption         =   "&Exit"
   End
End
Attribute VB_Name = "frmShip"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Compare Text

'
'
'
' Check for v800.
'2005-03-16, JFW, Enable Window controls and show in task bar.
'2005-03-16, JFW, For Canada, Recipient Tax ID, aka IRS number.
'2005-03-16, JFW, SetCAScreen called after integration changes country.  Mitigate it's impact.
'2005-03-28, JFW, Save f68 on clear screen.
'2005-03-28, JFW, New field 1266(2) on CA Intl.
'2005-03-29, JFW, Adopt source version 720.3.1
'2005-03-29, JFW, Commodity tables field order 120, 414, 1030, 1275, 119.
'2005-04-11, JFW, Recognize "already deleted" on MPS delete.
'2005-04-11, JFW, Rate quote fix for CA.
'2005-04-12, JFW, Comment out and hold this item:  Enable address lookup by default at startup.
'2005-04-13, JFW, Commodity grid heading for Total value and Part number.
'2005-04-21, JFW, On CA Intl frame (6) put TD check and View button.
'2005-04-28, JFW, Vantreight, corrections and testing.
'2006-11-07, JFW, Add order to MPS select to preserve package order
'2006-11-07, JFW, Add button switch between Order and Customer ID.
'2006-12-18, JFW, Save IRS number with address book update.
'2007-04-13, JFW, Repair to batch processing, AfterConnect event,
'2007-04-13, JFW, Protect against nulls in AddressBook.
'2007-04-20, JFW, Repair duplicate packages processing.
'2007-04-20, JFW, Fix Client shipment table location name.
'2007-04-23, JFW, Insert to Shipment table has named fields.
'                 Allows for new fields like Transaction to support future repeat function.
'2007-05-21, JFW, Repeat function for last shipment and shipments listing.
'2007-11-05, JFW, Sanofi, large AddressBook, test for Save and reload combos only if true
'2007-11-05, JFW, Added field 1370 for Doc Tab Orientation, Sanofi, mix of Orion and Zebra printers.
'2009-02-01, JFW, Change the date after midnight.  Medtronic.

Public WithEvents g_clsParser As clsFXRSParser  'FXRSParser class object
Attribute g_clsParser.VB_VarHelpID = -1

Dim m_intLastColumnSort As Integer              'Used to save the column index used in sorting
Dim m_blnSortOrder As Boolean                   'Used to save the sort order
Dim m_rsHistory As New ADODB.Recordset          'Shipping History recordset
Dim m_blnShift As Boolean                       'Set when shift is pressed to Select a range in Ship History
Dim m_intPrevious As Integer                    'Store previously selected row in Ship History
Dim m_intCurrent As Integer                     'Store current selected row in Ship History
' 2011-05-17, JFW, Manage changes to sensitive controls
Dim m_objControl As Control
Dim dtRateTime As Date
'

'declare api procedures
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
        (ByVal hwnd As Long, _
        ByVal wMsg As Long, _
        ByVal wParam As Long, _
        lParam As Any) As Long
 
'declare constants
Const CB_SHOWDROPDOWN = &H14F
 
 
Public Sub DropList(WhichCombo As Control, DropItDown As Boolean)
    On Error Resume Next
 
    Dim vTmpLng As Long
    vTmpLng = SendMessage(WhichCombo.hwnd, CB_SHOWDROPDOWN, _
                  ByVal Abs(CLng(DropItDown)), ByVal CLng(0))
End Sub

Public Sub RateShipScreen()

    Debug.Print Now, "RateShipScreen"
    g_blnRatePending = True
    dtRateTime = Now
    timerRate.Enabled = True
    
End Sub

Public Sub SetLocationName(strLocationName As String)
    Dim i As Long
    If frmShip.cboLocationName(0).Text <> strLocationName Then
        Call LoadNameCombo(frmShip.cboLocationName(0), strLocationName)
        frmSetup.cboName = strLocationName
        Call cboLocationName_Click(0)
        Call frmSetup.cboName_Click
        For i = 1 To 500
            DoEvents
        Next i
    End If
End Sub
'


'---------------------------------------------------------------------------------------
' Procedure : Calendar1_Click()
' DateTime  : 2/18/2004
' Purpose   : Puts date selected on calendar in ShipDate field.
'---------------------------------------------------------------------------------------
'
Private Sub Calendar1_DblClick()
    f24.Text = Calendar1.Value
    Calendar1.Visible = False
End Sub
'---------------------------------------------------------------------------------------
' Procedure : Calendar2_Click()
' DateTime  : 2/18/2004
' Purpose   : Puts date selected on calendar in Export License Expiration Date field.
'---------------------------------------------------------------------------------------
'
Private Sub Calendar2_DblClick()
    f84.Text = Calendar2.Value
    Calendar2.Visible = False
End Sub
'---------------------------------------------------------------------------------------
' Procedure : Calendar3_DblClick()
' DateTime  : 3/19/2004
' Purpose   : Puts the calendar value in the Ship Date field on the Shipped List tab,
'             moves the focus so the grdshipments will get updated, then hides the calendar.
'---------------------------------------------------------------------------------------
'
Private Sub Calendar3_DblClick()
    txtShipDate = Calendar3.Value
    If txtShipDate.Enabled Then txtShipDate.SetFocus
    If cboLocationName(1).Enabled Then cboLocationName(1).SetFocus
    Calendar3.Visible = False
End Sub
'---------------------------------------------------------------------------------------
' Procedure : Calendar4_DblClick()
' DateTime  : 7/19/2004
' Purpose   : Puts the calendar value in the Del Date field on the Ship tab for Optimization.
'---------------------------------------------------------------------------------------
'
Private Sub Calendar4_DblClick()
    txtDelDate = Calendar4.Value
    Calendar4.Visible = False
End Sub

'---------------------------------------------------------------------------------------
' Procedure : cboBatchProfile_Click()
' DateTime  : 6/19/2004
' Purpose   : Load selected batch profile selected on Batch tab to frmSetup.
'---------------------------------------------------------------------------------------
'
Private Sub cboBatchProfile_Click()
    Call frmSetup.LoadProfile(cboBatchProfile)
End Sub
'

Private Sub cboBoxName_Change()
    
    On Error GoTo EH
    
    '20080122-03 Update box DIMs after lost focus
    Call UpdateBoxDims(f57, f58, f59, cboBoxName.Text)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cboBoxName_LostFocus"

End Sub

Private Sub cboBoxName_Click()
    
    On Error GoTo EH
    
    '20080122-03 Update box DIMs after lost focus
    Call UpdateBoxDims(f57, f58, f59, cboBoxName.Text)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cboBoxName_LostFocus"

End Sub

'---------------------------------------------------------------------------------------
' Procedure : cboBoxName_LostFocus(Index As Integer)
' DateTime  : 7/7/2004
' Purpose   : DIMs combo on Ship & Service Quote tabs. Called on LostFocus to add or
'             update box dims
'---------------------------------------------------------------------------------------
'
Private Sub cboBoxName_LostFocus()
    
    On Error GoTo EH
    
    '20080122-03 Update box DIMs after lost focus
    Call UpdateBoxDims(f57, f58, f59, cboBoxName.Text)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cboBoxName_LostFocus"

End Sub
'

'---------------------------------------------------------------------------------------
' Procedure : cboClass_Change()
' DateTime  : 4/29/2005
' Purpose   : Calls SetComboSelection based on the first character typed
'---------------------------------------------------------------------------------------
'
Private Sub cboClass_Change()
    
    If Len(cboClass) >= 1 Then
        Call SetComboSelection(cboClass, cboClass)
    End If
    
End Sub
'---------------------------------------------------------------------------------------
' Procedure : cboClass_Click()
' DateTime  : 4/29/2005
' Purpose   : Set subclass to Parcel post for Std A and Priority Mail
'---------------------------------------------------------------------------------------
'
Private Sub cboClass_Click()
    
    If Left(cboClass, 1) = "A" Or Left(cboClass, 1) = "F" Then
        cboSubClass = "P"
    End If
    
    'Added for Std A del confirmation
    If Left(cboClass, 1) = "A" Then
        chkNoDelConfirm.Visible = True
    Else
        chkNoDelConfirm.Visible = False
    End If

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cboCommodityID_Click()
' DateTime  : 2/18/2004
' Purpose   : Commodity ID combo. Gets commodity info from Commodity table.
'---------------------------------------------------------------------------------------
'
Private Sub cboCommodityID_Click()
    Dim rsQuery As String
    Dim rsCommodity As New ADODB.Recordset
    
    On Error GoTo EH
    
    rsQuery = "SELECT * FROM Commodity WHERE CommodityID = '" & cboCommodityID & "'"
    rsCommodity.Open rsQuery, g_connFSMSClient, adOpenKeyset, adLockOptimistic
    
    If Not rsCommodity.EOF Then
        txtCommodityWgt = rsCommodity("CommodityWgt") & ""
        f79 = rsCommodity("g_str79") & ""
        f80(0) = rsCommodity("g_str80") & ""
        f81 = rsCommodity("g_str81") & ""
        f83 = rsCommodity("g_str83") & ""
        f84 = rsCommodity("g_str84") & ""
        f414 = rsCommodity("g_str414") & ""
        f1030 = rsCommodity("g_str1030") & ""
    
        ' 2007-06-06, JFW, good idea from JnJ
        f82 = 1
        If IsNumeric(f82) And IsNumeric(f1030) Then
            f78 = Round(CDbl(f82) * CDbl(f1030), 2)
        End If
        f120 = rsCommodity("g_str120") & ""
        f1275 = rsCommodity("g_str1275") & ""
            
        If NASCAR_VERSION >= "FSMSClient v800.2.1" Then
            If Not g_frmCommodityMore Is Nothing Then Unload g_frmCommodityMore
            Set g_frmCommodityMore = New frmCommodityMore
            g_frmCommodityMore.cboMID = rsCommodity("MID") & ""
            g_frmCommodityMore.cboDocument1 = rsCommodity("Document1") & ""
            g_frmCommodityMore.cboDocument2 = rsCommodity("Document2") & ""
            g_frmCommodityMore.cboDocument3 = rsCommodity("Document3") & ""
        End If
    
    End If

Release:
    
    If rsCommodity.State = adStateOpen Then
        rsCommodity.Close
    End If
    Set rsCommodity = Nothing

    Call AfterLostFocus(cboCommodityID)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cboCommodityID_Click"
    Resume Release
    
End Sub

Private Sub cboCommodityID_KeyPress(KeyAscii As Integer)

    On Error Resume Next
    DropList cboCommodityID, True
    
End Sub

Private Sub cboCommodityID_LostFocus()

    On Error Resume Next
    If cboCommodityID.Text <> UCase(cboCommodityID.Text) Then
        cboCommodityID.Text = UCase(cboCommodityID.Text)
    End If
    
End Sub

'---------------------------------------------------------------------------------------
' Procedure : cboCompany_KeyPress()
' DateTime  : 9/1/2004
' Purpose   : Calls routine to search combo for first matching value
'---------------------------------------------------------------------------------------
'
Private Sub cboCompany_KeyPress(KeyAscii As Integer)
        
    If cboCustID = "" And cboContact = "" Then Call SearchCombo(cboCompany, KeyAscii)

End Sub

'---------------------------------------------------------------------------------------
' Procedure : cboCompany_LostFocus()
' DateTime  : 8/31/2004
' Purpose   : Call sub to populate recipient fields
'---------------------------------------------------------------------------------------
'
Private Sub cboCompany_LostFocus()
    
    '20070830-01 Only do lookup if Company is not blank and CustID and Contact are blank
    If cboCompany <> "" And cboCustID = "" And cboContact = "" Then
        If LoadAddrFields("f11", cboCompany, Me) Then
            Call frmMPS.UpdateMPSGrid(cboCustID)
            Call AfterAddrLookup
        End If
    End If

    Set m_objAddressEditControl = cboCompany
End Sub
'---------------------------------------------------------------------------------------
' Procedure : cboContact_KeyPress()
' DateTime  : 9/1/2004
' Purpose   : Calls routine to search combo for first matching value
'---------------------------------------------------------------------------------------
'
Private Sub cboContact_KeyPress(KeyAscii As Integer)
        
    If cboCompany = "" And cboCustID = "" Then Call SearchCombo(cboContact, KeyAscii)
    
End Sub
'---------------------------------------------------------------------------------------
' Procedure : cboContact_LostFocus()
' DateTime  : 8/31/2004
' Purpose   : Call sub to populate recipient fields
'---------------------------------------------------------------------------------------
'
Private Sub cboContact_LostFocus()
    
    '20070830-01 Only do lookup if Contact is not blank and CustID and Company are blank
    If cboContact <> "" And cboCompany = "" And cboCustID = "" Then
        ' 2011-05-16, JFW, Fix tab index through Contact name
        If LoadAddrFields("f12", cboContact, Me) Then
            Call frmMPS.UpdateMPSGrid(cboCustID)
            Call AfterAddrLookup
        End If
    End If

    Set m_objAddressEditControl = cboContact
    Call AfterLostFocus(cboContact)
    
End Sub
'---------------------------------------------------------------------------------------
' Procedure : cboCustID_Change()
' DateTime  : 1/27/2005
' Purpose   : Makes sure buttons that require an OrderID/CustID are disabled if field is blank
'---------------------------------------------------------------------------------------
'
Private Sub cboCustID_Change()
    On Error GoTo EH
    
    cmdMPS.Enabled = MPSButtonEnable
    
    If cboCustID <> "" Then
        If optCommodities Then
            cmdAddToShipment.Enabled = True
            cmdViewCommodities.Enabled = True
        End If
    Else
        cmdAddToShipment.Enabled = False
        cmdViewCommodities.Enabled = False
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cboCustID_Change"


End Sub
'---------------------------------------------------------------------------------------
' Procedure : cboCustID_Click()
' DateTime  : 20071105-01
' Purpose   : Calls routine to enable MPS button
'---------------------------------------------------------------------------------------
'
Private Sub cboCustID_Click()
    cmdMPS.Enabled = MPSButtonEnable
End Sub

Private Sub cboCustID_DblClick()
    If f1.Visible Then
        Call SetLookup(False, Me)
    ElseIf cboCustID.Visible Then
        Call SetLookup(True, Me)
    End If
End Sub

'---------------------------------------------------------------------------------------
' Procedure : cboCustID_KeyPress()
' DateTime  : 9/1/2004
' Purpose   : Calls routine to search combo for first matching value
'---------------------------------------------------------------------------------------
'
Private Sub cboCustID_KeyPress(KeyAscii As Integer)

    If cboCompany = "" And cboContact = "" Then Call SearchCombo(cboCustID, KeyAscii)
    
End Sub

'---------------------------------------------------------------------------------------
' Procedure : cboCustID_LostFocus()
' DateTime  : 8/31/2004
' Modified  : 10/6/2005
' Purpose   : Looks populates recipient fields
'---------------------------------------------------------------------------------------
'
Private Sub cboCustID_LostFocus()
    
    Call AfterLostFocus(cboCustID)
    
    '20070830-01 Only do lookup if CustID is not blank and Contact and Company are blank
    If cboCustID <> "" And cboCompany = "" And cboContact = "" Then
        If LoadAddrFields("CustID", cboCustID, Me) Then
            Call frmMPS.UpdateMPSGrid(cboCustID)
            If f50.Enabled Then f50.SetFocus
            Call AfterAddrLookup
            Call AfterLostFocus(cboCustID)
            Call AfterLostFocus(f50)
        End If
    End If
      
    Set m_objAddressEditControl = cboCompany

End Sub


Private Sub cboEndorsement_Change()
    If Len(cboEndorsement) >= 1 Then
        Call SetComboSelection(cboEndorsement, cboEndorsement)
    End If
End Sub


Private Sub chkETD_Click(Index As Integer)
    On Error GoTo EH
    
    If chkETD(Index).Value = 1 Then
        If g_clsSettings.Setting("EDTCountries") = "" Then
            g_clsSettings.Setting("EDTCountries") = "AF,AL,AT,AU,BB,BE,BH,BM,CA,CH,CN,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GB,GB,GB,GB,HK,HR,HU,IE,IL,IN,IS,IT,IT,JP,KR,LI,LT,LU,LV,MC,MO,MX,MY,NL,NO,NZ,PH,PL,PR,PS,PT,SE,SG,SI,SK,SM,TH,TW,US,ZA"
        End If
        If 0 = InStr(1, g_clsSettings.Setting("EDTCountries"), Left(f50.Text & "  ", 2)) Then
            frmMsgBox.ShowMessage "EDT is not available to this country. ", 4000
            chkETD(Index).Value = 0
        End If
    End If
    
    chkETD((Index + 1) Mod 2).Value = chkETD(Index).Value
    If chkETD(Index).Value = 1 Then
        Call frmETD.AssignFormGlobalVars
    Else
        g_strETD = ""
    End If
    DebugPrint "ETD.Click, ETD " & g_strETD
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:ETDClick"

End Sub

Private Sub cmdAddressBook_Click()

    If f1.Visible Then
        Call SetLookup(False, Me)
    End If
    frmAddressEdit.ShipFromAddressBook

End Sub


Private Sub cmdViewCommodities_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Shift = 1 Then
        g_clsReg.SetRegistryValue "frmCommodities", "", REG_SZ
    End If
End Sub

Private Sub cmdViewETD_Click(Index As Integer)
    On Error GoTo EH
    
    With frmETD
        .Show vbModeless, Me
    End With
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:ViewETD"

End Sub

'---------------------------------------------------------------------------------------
' Procedure : cmdViewHazMat_Click()
' DateTime  : 20071016-03
' Purpose   : Show frmHazMat
'---------------------------------------------------------------------------------------
'
Private Sub cmdViewHazMat_Click()
    frmHazMat.Show vbModeless, Me
End Sub

Private Sub cmdViewPA_Click()
    frmPriorityAlert.Show vbModeless, Me
End Sub

Private Sub cmdViewTD_Click()
    ' 2011-04-26, JFW, Make sure no automated popup
    If g_blnFormLoadComplete Then
        Set g_frmTD = New frmTD
        g_frmTD.Show 1, Me
    End If
End Sub

Private Sub f1_DblClick()
    If f1.Visible Then
        Call SetLookup(False, Me)
    ElseIf cboCustID.Visible Then
        Call SetLookup(True, Me)
    End If
End Sub

Private Sub f11_Change()
    Set m_objAddressEditControl = f11
End Sub

Private Sub f12_Change()
    Set m_objAddressEditControl = f12
End Sub

Private Sub f1275_LostFocus()
    Call AfterLostFocus(f1275)
End Sub

Private Sub f13_Change()
    Set m_objAddressEditControl = f13
End Sub

Private Sub f14_Change()
    Set m_objAddressEditControl = f14
End Sub

Private Sub f1482_Click()

    On Error GoTo EH
    g_strErrorLocation = "frmShip:f1482_Click"
    
    If f1482.Value = 1 Then
        If Left(f50.Text, 2) <> "US" Then
            f50.Text = "US"
        End If
        optCommodities.Value = True
    End If
    
    ' 2011-04-28, JFW, TD form only when TD turned on
    If f1482.Value = 1 And g_strTDMasterTrkNbr = "" Then
        If g_blnFormLoadComplete Then
            Set g_frmTD = New frmTD
            g_frmTD.Show 1, Me
        End If
    End If
    
    If g_strTDMasterTrkNbr = "" Then
        f1482.Value = 0
    End If
        
    Call DomIntlScreenLayout
    Call LoadServices(Left(f1274, 2))
    
    Call LoadPackaging(Left(f1273, 2))
    Call ShowSpecialSvcs
    If Left(f50, 2) = "US" Then
        Call LoadStates(f16, f16)
    ElseIf Left(f50, 2) = "CA" Then
        Call LoadProvinces(f16, f16)
    Else
        f16.Clear
    End If
    
    Call AfterLostFocus(f1482)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, g_strErrorLocation
    
End Sub

Private Sub f15_Change()
    Set m_objAddressEditControl = f15
End Sub

Private Sub f16_LostFocus()
    Set m_objAddressEditControl = f16
End Sub

Private Sub f1670_LostFocus()

    Call AfterLostFocus(f1670)
    
End Sub

Private Sub f2382_Click(Index As Integer)

    Dim i As Long
    
    For i = 0 To f2382.UBound
        If i <> Index Then
            If f2382(i) <> f2382(Index) Then
                f2382(i) = f2382(Index)
            End If
        End If
    Next

    Call AfterLostFocus(f2382(Index))
    
End Sub

'---------------------------------------------------------------------------------------
' Procedure : f24_LostFocus()
' DateTime  : 20070813-01
' Purpose   : If invalid date entered set to today's date, else make sure format is correct.
'---------------------------------------------------------------------------------------
'
Private Sub f24_LostFocus()
    If Not IsDate(f24) Then
        f24 = Date
    Else
        f24 = Format(f24, "M/D/YYYY")
    End If
    Call AfterLostFocus(f24)
End Sub

Private Sub f38_Change()
    Call AfterLostFocus(f38)
End Sub

'---------------------------------------------------------------------------------------
' Procedure : f38_KeyPress()
' DateTime  : 6/01/2006
' Purpose   : Calls routine to search combo for first matching value
'---------------------------------------------------------------------------------------
'
Private Sub f38_KeyPress(KeyAscii As Integer)
    
    Call SearchCombo(f38, KeyAscii)
    
End Sub
'---------------------------------------------------------------------------------------
' Procedure : cboLocationName_Click()
' DateTime  : 7/6/2004
' Purpose   : Location Name combo on Ship and Shipping History tabs. If clicked from
'             Ship tab, set the frmSetup Location to frmShip location (add 1 to index
'             since frmSetup has [Create New] as first item), set the Location on the
'             Shipping History to Ship tab location, then call frmSetup routines to save
'             new location information.
'             If clicked from Shipping History, update the grid.
'---------------------------------------------------------------------------------------
'
Private Sub cboLocationName_Click(Index As Integer)
    Set m_objControl = cboLocationName(Index)
    timerControl.Enabled = True
End Sub

Private Sub cboSubClass_Change()
    If Len(cboSubClass) >= 1 Then
        Call SetComboSelection(cboSubClass, cboSubClass)
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : chkAddrVerifyBatch_Click()
' DateTime  : 9/16/2005
' Purpose   : If Addr Verify checked on Batch tab change Ship All caption to Verify.
'---------------------------------------------------------------------------------------
'
Private Sub chkAddrVerifyBatch_Click()
    If chkAddrVerifyBatch = 1 Then
        cmdShipAll.Caption = "Verify"
        chkBatchErrorCheck = 0
        chkBatchErrorCheck.Enabled = False
        '6/30/06 Change label to show soft errors
        Label1(24) = "Number of Soft Errors:"
    Else
        cmdShipAll.Caption = "Ship All"
        chkBatchErrorCheck.Enabled = True
        '6/30/06 Change label to show soft errors
        Label1(24) = "Number Shipped:"
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : chkAllDates_Click()
' DateTime  : 3/13/2006
' Purpose   : Disable Ship Date field and calendar icon on Ship History.
'---------------------------------------------------------------------------------------
'
Private Sub chkAllDates_Click()
    If chkAllDates = 1 Then
        txtShipDate.Enabled = False
        Image4.Enabled = False
        Label1(44).Enabled = False
    Else
        txtShipDate.Enabled = True
        Image4.Enabled = True
        Label1(44).Enabled = True
    End If
    'If Search Value is not blank, pass search field and search value
    If txtSearchValue = "" Then
        Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus)
    Else
        Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus, cboSearchField, txtSearchValue)
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : chkB13A_Click()
' DateTime  : 3/3/2005
' Purpose   : Show the B13A form if checked. If unchecked set the globals vars from that
'             form to empty string so they are not included in the transaction.
'---------------------------------------------------------------------------------------
'
Private Sub chkB13A_Click()
    If chkB13A = 1 Then
        frmB13A.Show vbModeless, Me
    Else
        g_str1651 = "1"
        g_str1652 = ""
        g_str1653 = ""
    End If
End Sub

'---------------------------------------------------------------------------------------
' Procedure : chkBatchErrorCheck_Click()
' DateTime  : 7/18/2004
' Purpose   : Batch Error Check checkbox clicked. If selected set boolean and change
'             Ship All button caption to Error Check.
'---------------------------------------------------------------------------------------
'
Private Sub chkBatchErrorCheck_Click()
    If chkBatchErrorCheck = 1 Then
        cmdShipAll.Caption = "Error Check"
        g_blnBatchErrorCheck = True
        chkAddrVerifyBatch = 0
        chkAddrVerifyBatch.Enabled = False
        '6/30/06 Disable label for Number Shipped
        Label1(24).Enabled = False
    Else
        cmdShipAll.Caption = "Ship All"
        g_blnBatchErrorCheck = False
        chkAddrVerifyBatch.Enabled = True
        '6/30/06 Enable label for Number Shipped
        Label1(24).Enabled = True
    End If
End Sub

'---------------------------------------------------------------------------------------
' Procedure : chkDuplicate_Click()
' DateTime  : 2/18/2004
' Purpose   : Identical Pkgs check box. If checked or pkg count < 2, disable MPS button.
'---------------------------------------------------------------------------------------
'
Private Sub chkDuplicate_Click()
    On Error GoTo EH
    
    Dim i As Integer
    
    'Added 6/7 - MPSButtonEnable looks at all factors to determine if it can be enabled
    cmdMPS.Enabled = MPSButtonEnable
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:chkDuplicate_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : chkEmailAlert_Click()
' DateTime  : 2/18/2004
' Purpose   : Show Email form
'---------------------------------------------------------------------------------------
'
Private Sub chkEmailAlert_Click()
    On Error GoTo EH
    
    If chkEmailAlert = 1 Then
        frmEmail.Show vbModeless, Me
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:chkEmailAlert_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : chkIntlIPD_Click()
' DateTime  : 12/22/2005
' Purpose   : Call routine to Enable/disable fields when IPD is selected/deselected.
'---------------------------------------------------------------------------------------
'
Private Sub chkIntlIPD_Click()

    Call EnableDisableIPD(chkIntlIPD)
    Call AfterLostFocus(chkIntlIPD)
    
End Sub
'---------------------------------------------------------------------------------------
' Procedure : chkIPD_Click()
' DateTime  : 10/25/2004
' Purpose   : Call routine to Enable/disable fields when IPD is selected/deselected.
'---------------------------------------------------------------------------------------
'
Private Sub chkIPD_Click()
    
    Call EnableDisableIPD(chkIPD)
    
End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdAddToShipment_Click()
' DateTime  : 2/18/2004
' Purpose   : Commodity Add to Shipment button. Does minimal error checking then calls
'             routines to add commodity to database, cleaer the commodity fields and
'             update the datagrid.
'---------------------------------------------------------------------------------------
'
Private Sub cmdAddToShipment_Click()
    
    On Error GoTo EH
    
    Dim strErrors As String
    
    'If FedEx printing CI check for missing fields
    If g_str113 = "Y" Then
        strErrors = CommodCheck
    End If
    
    'If no errors
    If strErrors = "" Then
        Call AddCommodityToMDB
        Call ClearCommodityFields
        'Updated 9/2/05
        Call SetCommodSummary
        ' 2012-01-04, JFW, Introduced for UCS
        Call ClearCommodity
    Else
        MsgBox strErrors, vbExclamation, "Add Commodity Error"
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cmdAddToShipment_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdApptDel_Click()
' DateTime  : 2/18/2004
' Purpose   : Appt Del View/Edit button. Show Appt Del form.
'---------------------------------------------------------------------------------------
'
Private Sub cmdApptDel_Click()
    On Error GoTo EH
    
    frmApptDelivery.Show vbModeless, Me
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cmdApptDel_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdBrowse_Click()
' DateTime  : 2/18/2004
' Purpose   : Browse button. Show common dialog to select batch file for processing.
'---------------------------------------------------------------------------------------
'
Private Sub cmdBrowse_Click()
    On Error GoTo EH
    
    If frmSetup.txtFilesPath <> "" Then
        cdlBatchFilename.InitDir = frmSetup.txtFilesPath
    Else
        cdlBatchFilename.InitDir = App.Path
    End If
    
    cdlBatchFilename.ShowOpen
    txtBatchFilename = cdlBatchFilename.FileName
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cmdBrowse_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : ClearButton()
' DateTime  : 2/18/2004
' Purpose   : Clear button. Calls routine to clear screen fields, global vars and errors.
'---------------------------------------------------------------------------------------
'
Public Sub ClearButton()
    On Error GoTo EH
    
    If SSTab1.Tab = 2 Then
        Call ClearBatchTab
        '6/30/06 Uncheck check boxes
        chkBatchErrorCheck = 0
        chkAddrVerifyBatch = 0
    ElseIf SSTab1.Tab = 3 Then
        Call ClearHistoryTab
    Else
        If SSTab1.Tab <> 0 Then SSTab1.Tab = 0
        Call ClearShipFields
        Call ClearGlobalVars
        Call SetLogo
        g_str3 = ""
        Call ClearShipScreen
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:ClearButton"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : CloseButton()
' DateTime  : 2/18/2004
' Purpose   : Close button. Show Close form.
'---------------------------------------------------------------------------------------
'
Private Sub CloseButton()
    On Error GoTo EH
    
    Call DisableButtons
    frmClose.Show vbModeless, Me
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:CloseButton"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdCustom_Click(Index As Integer)
' DateTime  : 5/11/2004
' Purpose   : One of the Custom buttons is clicked. Calls on of the three CustomButton
'             subroutines in modCustomButtons. CICs must define the functionality of
'             these buttons, and they must be enabled in the setup.
'---------------------------------------------------------------------------------------
'
Private Sub cmdCustom_Click(Index As Integer)
    On Error GoTo EH
    
    Select Case Index
        Case 1
            Call CustomButton1
        Case 2
            Call CustomButton2
        Case 3
            Call CustomButton3
    End Select
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cmdCustom_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdDateCertain_Click()
' DateTime  : 2/18/2004
' Purpose   : Date Certain View/Edit button. Show Date Certain form.
'---------------------------------------------------------------------------------------
'
Private Sub cmdDateCertain_Click()
    On Error GoTo EH
    
    frmDateCertain.Show vbModeless, Me
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cmdDateCertain_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : DeleteButton()
' DateTime  : 3/15/2005
' Updated   : 8/16/2005 Fixed CRN Delete and changed .Fields(Index) to .Fields("Fieldname")
'           : 4/28/2006 Fixed Returns deletes
' Purpose   : Delete button. If on Shipping History send Delete transaction for each
'             row selected in grid, else show Delete form.
'
' 2008-10-01, JFW, Made public for Modify function.
'---------------------------------------------------------------------------------------
'
Public Sub DeleteButton()
    Dim vntBookMark As Variant
    Dim intNumBookMarks As Integer
    Dim intAnswer As Integer
    Dim str1123 As String
    
    On Error GoTo EH
    
    If SSTab1.Tab = 3 Then
        With m_rsHistory
            intNumBookMarks = grdShipments.SelBookmarks.Count
            '07/12/06 Added And so nothing happens when showing Deleted pkgs
            If intNumBookMarks > 0 And cboShipmentStatus <> "Deleted" Then
                'If Express MPS Show message stating the entire shipment will be deleted
                If Left(cboShipmentType, 7) = "Express" Then
                    If .Fields("g_str1123") <> "" And Right(cboShipmentType, 3) <> "IPD" Then
                    
                        intAnswer = MsgBox("Deleting an MPS tracking number will delete the entire shipment." & vbCrLf & _
                        "Are you sure you want to delete this shipment?", vbYesNo, "Confirm Delete")
                    Else
                        intAnswer = MsgBox("Are you sure you want to delete these " & Str(intNumBookMarks) & " tracking numbers?", vbYesNo, "Confirm Delete")
                    End If
                Else
                    intAnswer = MsgBox("Are you sure you want to delete these " & Str(intNumBookMarks) & " tracking numbers?", vbYesNo, "Confirm Delete")
                End If
                If intAnswer = vbYes Then
                    '02/22/06 Added to clear Shift select boolean
                    m_blnShift = False
                    For Each vntBookMark In grdShipments.SelBookmarks
                        g_blnDeletesComplete = False
                        Call DisableButtons
                        .Bookmark = vntBookMark
                        g_blnComplete = False
                        If cboShipmentType = "Express IPD" Then
                            Call SendData(BuildCRNDeleteTrans(.Fields("g_str29"), .Fields("g_str1355"), .Fields("g_str50")))
                        ElseIf cboShipmentType = "SmartPost" Then
                            Dim intRet As Integer
                            
                            intRet = DeleteSPPkg(.Fields("g_str29"))
                            Select Case intRet
                                Case 0
                                    StatusBar1.Panels(2) = .Fields("g_str29") & " Deleted!"
                                    Call WriteDelete(.Fields("g_str29"))
                                Case 1
                                    Call WriteDelete(.Fields("g_str29"))
                                    MsgBox .Fields("g_str29") & " has already been deleted.", vbExclamation, "Delete Error"
                                    StatusBar1.Panels(2) = "Deleted Error!"
                                Case 2
                                    MsgBox .Fields("g_str29") & " has already been manifested.", vbExclamation, "Delete Error"
                                    StatusBar1.Panels(2) = "Deleted Error!"
                                Case 3
                                    Call WriteDelete(.Fields("g_str29"))
                                    MsgBox .Fields("g_str29") & " not found.", vbExclamation, "Delete Error"
                                    StatusBar1.Panels(2) = "Deleted Error!"
                            End Select
                            Call EnableButtons
                            
                        ElseIf Right(Trim(cboShipmentType), 3) = " TD" Then
                        
                            Call SendData(BuildTDCDeleteTrans(.Fields("g_str29"), ""))

                        ElseIf Left(cboShipmentType, 6) = "Ground" Then
                            Call SendData(BuildDeleteTrans(.Fields("g_str29")))
                        '4/28/06 Added for Returns
                        ElseIf Left(cboShipmentType, 7) = "Returns" Then
                            Call SendData(BuildDeleteTrans(.Fields("g_str29")))
                        Else
                            'If not MPS or current Master doesn't equal last master then delete
                            If str1123 = "" Or str1123 <> .Fields("g_str1123") Then
                                Call SendData(BuildDeleteTrans(.Fields("g_str29")))
                            'Pause 1 sec for status to be updated in DB, set boolean to True
                            Else
                                Call Pause(MULTIPLE_DELETE_DELAY)
                                g_blnComplete = True
                                'Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus)
                                'Call SetTrackButtons
                            End If
                            'Save Master trk#
                            If .RecordCount > 0 Then
                                str1123 = .Fields("g_str1123")
                            Else
                                str1123 = ""
                            End If
                        End If
                        intNumBookMarks = intNumBookMarks - 1
                        If intNumBookMarks = 0 Then
                            g_blnDeletesComplete = True
                        End If
                        'Pause until reply received on first delete
                        Do Until g_blnComplete
                            DoEvents
                        Loop
                    Next
                    Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus)
                    Call SetTrackButtons
                End If
            End If
        End With
    Else
        Call DisableButtons
        frmDelete.Show vbModeless, Me
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:DeleteButton"

End Sub

'---------------------------------------------------------------------------------------
' Procedure : cmdMenu_Click()
' DateTime  : 5/18/2004
' Purpose   : Buttons on the bottom of the screen are clicked, call appropriate sub.
'---------------------------------------------------------------------------------------
'
Private Sub cmdMenu_Click(Index As Integer)
    On Error GoTo EH
    
    Select Case Index
        Case 0
            Call ClearButton
        Case 1
            Call DeleteButton
        Case 2
            Call CloseButton
        Case 3
            Call TrackButton
        Case 4
            Call RefTrackButton
        Case 5
            Call RateButton
        Case 6
            Call ShipButton
        Case 7
            Call ReLabelButton
    End Select
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cmdMenu_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdMPS_Click()
' DateTime  : 3/18/2004
' Purpose   : Show MPS form
'---------------------------------------------------------------------------------------
'
Private Sub cmdMPS_Click()
    On Error GoTo EH
    
    frmMPS.Show vbModeless, Me
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cmdMPS_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : RateButton()
' DateTime  : 6/10/2004
' Purpose   : If on the Ship tab, rate the package using fields on this screen. If on
'             Rate tab, calll routine to rate all services.
'---------------------------------------------------------------------------------------
'
Public Sub RateButton()
    On Error GoTo EH
    
    Dim strSPRateMsg As String
    
    ' Call DisableButtons
    Call AssignTextToGlobal
        
        Debug.Print Now, "RateButton"

    StatusBar1.Panels(3) = "Rating..."
    DoEvents
    g_blnRatePending = False
    
    If Left(f1274, 2) = "99" Then
        If f17 = "" Or Len(f17) < 5 Then
            MsgBox "Please enter a valid Zipcode", vbExclamation, "Rate Error"
            ' 2010-04-30, JFW, Rate in spot 3
            StatusBar1.Panels(3) = "Rate Error"
            '10/6/05 only set focus If locked
            If f17.Enabled Then f17.SetFocus
        ElseIf f1670 = "" Then
            MsgBox "Please enter a Weight", vbExclamation, "Rate Error"
            ' 2010-04-30, JFW, Rate in spot 3
            StatusBar1.Panels(3) = "Rate Error"
            '10/6/05 only set focus If locked
            If f1670.Enabled Then f1670.SetFocus
        ElseIf cboClass = "" Then
            MsgBox "Please enter a Postal Class", vbExclamation, "Rate Error"
            ' 2010-04-30, JFW, Rate in spot 3
            StatusBar1.Panels(3) = "Rate Error"
            '10/6/05 only set focus If locked
            If cboClass.Enabled Then cboClass.SetFocus
        Else
            strSPRateMsg = RateSP(Left(f17, 5), f1670, Left(cboClass, 1))
            If strSPRateMsg = "-1" Then
                ' 2010-04-30, JFW, Rate in spot 3
                StatusBar1.Panels(3) = "Rate Error"
            ElseIf strSPRateMsg = "-2" Then
                ' 2010-04-30, JFW, Rate in spot 3
                StatusBar1.Panels(3) = "Zip not served"
            Else
                ' 2010-04-30, JFW, Rate in spot 3
                StatusBar1.Panels(3) = "Rate: $" & Format(strSPRateMsg, "###.00")
            End If
        End If
        Call EnableButtons
    '20070606-01 added code to rate LTL
    ElseIf Left(f1274, 3) = "111" Then
        
        Call ParseXMLReply(SendXMLData(BuildFreightRate))
        If g_str3 <> "" Then
            ' 2010-04-30, JFW, Rate in spot 3
            StatusBar1.Panels(3) = "Rate Error"
            MsgBox g_str3, vbExclamation, "LTL Rating Error"
        Else
            ' 2010-04-30, JFW, Rate in spot 3
            StatusBar1.Panels(3) = "Rate: " & g_str37
        End If
        
        Call EnableButtons
    Else
        Call SendData(BuildRateTrans("RATE ONLY"))
    End If
    
    ' Call ClearGlobalVars
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:RateButton"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdSearch_Click()
' DateTime  : 6/10/2004
' Purpose   : Search button on Shipping History clicked. Update grid passing search field
'             and value.
'---------------------------------------------------------------------------------------
'
Private Sub cmdSearch_Click()
    On Error GoTo EH
    
    Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus, cboSearchField, txtSearchValue)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cmdSearch_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdShipAll_Click()
' DateTime  : 2/18/2004
' Purpose   : For batch all, disable other FXRS function buttons, process the batchfile,
'             then enable the other FXRS buttons.
'---------------------------------------------------------------------------------------
'
Private Sub cmdShipAll_Click()
    
    On Error GoTo EH
    
        If txtBatchFilename = "" Then
            MsgBox "Please Enter or Select a Batch Filename", vbExclamation, "Filename Error"
            'Only set focus if enabled
            If txtBatchFilename.Enabled Then txtBatchFilename.SetFocus
            Exit Sub
        End If
        
        Call ClearBatchTab
        Call DisableButtons
        g_blnBatch = True
        cmdAbortBatch.Enabled = True
        
        'Save the Batch Filename & Profile
        With g_clsReg
            .SetRegistryValue "BatchFilename", txtBatchFilename, REG_SZ
            .SetRegistryValue "ProfileName", cboBatchProfile, REG_SZ
        End With
        
        StatusBar1.Panels(2) = "Processing batch..."
        
        '20070327-02 removed SPPlus batch and added strType parameter to ProcessBatch
        If chkAddrVerifyBatch = 1 Then
            Call ProcessAddrVerifyBatch(txtBatchFilename)
        '20070511-02 Changed this to look at the cboProfileType. chkSPProfile was removed.
        ElseIf Left(frmSetup.cboProfileType, 3) = "099" Then
            Call ProcessSPBatch(txtBatchFilename)
        Else
            Call ProcessBatch(txtBatchFilename, Left(frmSetup.cboProfileType, 3))
        End If
        
        'Batch done set button and batch flag
        Call EnableButtons
        g_blnBatch = False
        If g_blnAbortBatch Then
            MsgBox "Processing Aborted", vbExclamation, "Batch Processing"
            frmShip.StatusBar1.Panels(2) = "Batch Aborted"
            g_blnAbortBatch = False
        Else
            MsgBox "Processing Complete", vbExclamation, "Batch Processing"
            frmShip.StatusBar1.Panels(2) = "Batch Complete"
        End If
        cmdAbortBatch.Enabled = False
        
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cmdShipAll_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdAbortBatch_Click()
' DateTime  : 4/30/2004
' Purpose   : Aborts Batch processing
'---------------------------------------------------------------------------------------
'
Private Sub cmdAbortBatch_Click()
    On Error GoTo EH
    
    g_blnAbortBatch = True
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cmdAbortBatch_Click"

End Sub
'

'---------------------------------------------------------------------------------------
' Procedure : TrackButton()
' DateTime  : 6/10/2004
' Purpose   : Calls TrackIt to track by trk#
'---------------------------------------------------------------------------------------
'
Private Sub ReLabelButton()

    Dim strTrackNO As String
    strTrackNO = grdShipments.Columns("Trk #")
    
    'Exit sub if blank, else update status message
    If strTrackNO = "" Then
        Exit Sub
    Else
        frmShip.StatusBar1.Panels(2) = "Re-printing Trk# " & strTrackNO
    End If

    'Extracts trk# from a ASTRA barcode scanned into the f29 field
    'Not here
    'If Len(strTrackNo) = 32 And (Left(strTrackNo, 1) = "3" Or Left(strTrackNo, 1) = "4") Then
    '    strTrackNo = Mid(strTrackNo, 17, 12)
    'End If
    'Extracts trk# from a FedEx Ground barcode scanned into the f29 field
    'If Len(f29) = 22 And Left(f29, 2) = "96" Then
    '    f29 = Right(f29, 15)
    'End If
    
    g_str29 = strTrackNO
    
    '8/14/06 Added for SmartPost
    If frmSetup.chkCustomLabels = 1 Then
        Call ReprintCustomLabel(strTrackNO)
    ElseIf Len(strTrackNO) = 30 And Left(strTrackNO, 3) = "420" Then
        Call ReprintSPLabel(strTrackNO)
    Else
        Call SendData(BuildLabelReprintTrans(strTrackNO))
    End If


End Sub
'

'---------------------------------------------------------------------------------------
' Procedure : ToggleLookup()
' DateTime  : 8/30/2004
' Purpose   : Called from Form_Keyup if CTRL-A is pressed it switched back and forth
'             between Order ID and Cust ID lookup.
'---------------------------------------------------------------------------------------
'
Public Sub ToggleLookup(Optional pShowCustomer As Variant)
    
    On Error GoTo EH
    
    If g_blnFormLoadComplete Then Call cmdMenu_Click(0)
    If Not IsEmpty(pShowCustomer) Then
        Call SetLookup(pShowCustomer, Me)
    ElseIf f1.Visible Then
        Call SetLookup(False, Me)
    ElseIf cboCustID.Visible Then
        Call SetLookup(True, Me)
    End If
    Exit Sub
    
EH:
    MsgBox Err.Description, vbCritical, g_strErrorLocation

End Sub


'---------------------------------------------------------------------------------------
' Procedure : TrackButton()
' DateTime  : 6/10/2004
' Purpose   : Calls TrackIt to track by trk#
'---------------------------------------------------------------------------------------
'
Private Sub TrackButton()
    On Error GoTo EH
    
    If cboShipmentType = "SmartPost" Then
        Call TrackSPByTrkNum(frmSetup.txtCustID, grdShipments.Columns("Trk #"))
    Else
        Call TrackIt(grdShipments.Columns("Trk #"))
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:TrackButton"

End Sub
'

'---------------------------------------------------------------------------------------
' Procedure : RefTrackButton()
' DateTime  : 6/10/2004
' Purpose   : Calls TrackItRef and passes the appropriate reference, reftype & acct#
'---------------------------------------------------------------------------------------
'
Private Sub RefTrackButton()
    Dim blnRefNotEmpty(4) As Boolean
    Dim intCount As Integer
    Dim i As Integer
    Dim strQuery As String
    Dim strAcctNum As String
    Dim rsAcctNum As New ADODB.Recordset
    
    On Error GoTo EH
    
    'Get acct# for query
    If cboLocationName(1) = frmSetup.cboName Then
        strAcctNum = frmSetup.f10
    ElseIf cboLocationName(1) <> "" Then
        strQuery = "SELECT f10 FROM Meters WHERE Name = " & SingleQuotes(cboLocationName(1))
        rsAcctNum.Open strQuery, g_connFSMSClient, adOpenKeyset, adLockOptimistic
        If Not rsAcctNum.EOF Then
            strAcctNum = rsAcctNum!f10
        End If
        rsAcctNum.Close
    End If
    
    'Ground/FHD
    If Left(cboShipmentType, 10) = "Ground/FHD" Then
        intCount = 0
        'Set boolean for Ground ref fields that have data
        For i = 1 To 3
            If grdShipments.Columns(i + 1) <> "" Then
                blnRefNotEmpty(i) = True
                intCount = intCount + 1
            End If
        Next
        'If only 1 ref field has data ref track using that field
        If intCount = 1 Then
            For i = 1 To 3
                If blnRefNotEmpty(i) = True Then
                    Call TrackItRef(grdShipments.Columns(i + 1), strAcctNum)
                End If
            Next
        'Else show the Ground Ref Track form enabling option buttons for fields that have data
        ElseIf intCount > 1 Then
            frmTrackGroundRef.Show vbModeless, Me
            For i = 1 To 3
                If blnRefNotEmpty(i) = True Then
                    frmTrackGroundRef.optRefType(i).Enabled = True
                Else
                    frmTrackGroundRef.optRefType(i).Enabled = False
                End If
            Next
        End If
    ElseIf cboShipmentType = "SmartPost" Then
        'SmartPost track by column 2, Reference
        If grdShipments.Columns("Trk #") <> "" Then
            Call TrackSPByTrkNum(frmSetup.txtCustID, grdShipments.Columns("Reference"))
        End If
    ElseIf Left(cboShipmentType, 7) = "Express" Then
        'Express track by column 2, Reference
        If grdShipments.Columns("Trk #") <> "" Then
            Call TrackItRef(grdShipments.Columns("Reference"), strAcctNum)
        End If
    End If
    
Release:
    If rsAcctNum.State = adStateOpen Then rsAcctNum.Close
    Set rsAcctNum = Nothing

    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:RefTrackButton"
    Resume Release

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdViewAlcohol_Click(index As Integer)
' DateTime  : 3/16/2004
' Purpose   : Show Alcohol form, Dom and Intl.
'---------------------------------------------------------------------------------------
'
Private Sub cmdViewAlcohol_Click(Index As Integer)
    On Error GoTo EH
    
    frmAlcohol.Show vbModeless, Me
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cmdViewAlcohol_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdViewBSO_Click()
' DateTime  : 3/16/2004
' Purpose   : Show BSO form.
'---------------------------------------------------------------------------------------
'
Private Sub cmdViewBSO_Click(Index As Integer)
    On Error GoTo EH
    
    frmBSO.Show vbModeless, Me
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cmdViewBSO_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdViewCOD_Click(index As Integer)
' DateTime  : 3/16/2004
' Purpose   : Show COD form, Dom and Intl.
'---------------------------------------------------------------------------------------
'
Private Sub cmdViewCOD_Click(Index As Integer)
    On Error GoTo EH
    
    '01/10/06 Modified for LTL COD
    ' 2010-06-04, JFW, For CMA, all COD option applicable for Ground
    With frmCOD
        If Left(f1274, 2) = "92" Then
            .optCollectType(2).Visible = True
            .optCollectType(0).Caption = "Any Funds"
            .optCollectType(1).Caption = "Secured Funds ONLY"
            '.f3014.Visible = True
            '.chkCOD1stPiece.Visible = True
            '.fraCOD.Visible = True
            '.fraLTLCOD.Visible = False
        ElseIf Left(f1274, 3) = "111" Then
            .optCollectType(2).Visible = True
            .optCollectType(0).Caption = "Certified Funds"
            .optCollectType(1).Caption = "Company Check"
            .optCollectType(2).Caption = "Personal Check"
            '.f3014.Visible = False
            '.chkCOD1stPiece.Visible = False
            '.fraLTLCOD.Visible = True
            '.fraCOD.Visible = False
        Else
            .optCollectType(2).Visible = False
            .optCollectType(0).Caption = "Secured Check"
            .optCollectType(1).Caption = "Non-Secured Check"
            '.f3014.Visible = False
            '.chkCOD1stPiece.Visible = False
            '.fraCOD.Visible = True
            '.fraLTLCOD.Visible = False
        End If
        .Show vbModeless, Me
    End With
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cmdViewCOD_Click"

End Sub

Private Sub cmdViewCommodities_Click()
    frmCommodities.Show vbModeless, Me
End Sub

Private Sub cmdViewDG_Click(Index As Integer)
    frmDG.Show vbModeless, Me
End Sub

'---------------------------------------------------------------------------------------
' Procedure : cmdViewDryIce_Click(index As Integer)
' DateTime  : 3/16/2004
' Purpose   : Show Dry Ice form, Dom and Intl.
'---------------------------------------------------------------------------------------
'
Private Sub cmdViewDryIce_Click(Index As Integer)
    On Error GoTo EH
    
    frmDryIce.Show vbModeless, Me
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cmdViewDryIce_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdViewHAL_Click()
' DateTime  : 3/16/2004
' Purpose   : Show Domestic HAL form.
'---------------------------------------------------------------------------------------
'
Private Sub cmdViewHAL_Click(Index As Integer)
    On Error GoTo EH
    
    frmHAL.Show vbModeless, Me
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cmdViewHAL_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdViewIPD_Click()
' DateTime  : 12/22/2005
' Purpose   : Show IPD form.
'---------------------------------------------------------------------------------------
'
Private Sub cmdViewIntlIPD_Click()
    If g_frmIPD Is Nothing Then Set g_frmIPD = New frmIPD
    g_frmIPD.Show vbModeless, Me
End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdViewIPD_Click()
' DateTime  : 11/10/2004
' Purpose   : Show IPD form.
'---------------------------------------------------------------------------------------
'
Private Sub cmdViewIPD_Click()
    If g_frmIPD Is Nothing Then Set g_frmIPD = New frmIPD
    g_frmIPD.Show vbModeless, Me
End Sub

Private Sub cmdViewReturnLbl_Click(Index As Integer)
    frmReturnLbl.Show vbModeless, Me
End Sub

Private Sub cmdViewSigReq_Click(Index As Integer)
    frmSigReq.Show vbModeless, Me
End Sub

'---------------------------------------------------------------------------------------
' Procedure : f1_Change()
' DateTime  : 3/16/2004
' Purpose   : Enables/disables buttons that require an Order ID
'---------------------------------------------------------------------------------------
'
Private Sub f1_Change()
    On Error GoTo EH
    
    If f1 <> "" Then
        If optCommodities Then
            cmdAddToShipment.Enabled = True
            cmdViewCommodities.Enabled = True
        End If
    Else
        cmdAddToShipment.Enabled = False
        cmdViewCommodities.Enabled = False
    End If
    
    Set m_objAddressEditControl = f1
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f1_Change"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1_LostFocus()
' DateTime  : 3/16/2004
' Purpose   : Get order info if Order ID field not empty.
'---------------------------------------------------------------------------------------
'
Private Sub f1_LostFocus()
    On Error GoTo EH
    
    If f1 <> "" Then
        If GetData(f1) Then
        
            'MsgBox "f1_LostFocus 1 " & f1670.Text
        
            Call frmMPS.UpdateMPSGrid(f1)
            
            'MsgBox "f1_LostFocus 2 " & f1670.Text
            
            ' 2010-05-26, JFW, No integration must set next field
            ' f1670.SetFocus
            
            'MsgBox "f1_LostFocus 3 " & f1670.Text
            
            StatusBar1.Panels(2) = ""
        Else
            StatusBar1.Panels(2) = "Order " & f1 & " Not Found"
        End If
        '20080122-01 Moved here so MPS is enabled when GetData returns False
        cmdMPS.Enabled = MPSButtonEnable
    End If

    'MsgBox "f1_LostFocus out " & f1670.Text
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f1_LostFocus"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1030_Change()
' DateTime  : 3/16/2004
' Purpose   : Commodity Unit Value is numeric, decimal allowed with a max length of 16.
'---------------------------------------------------------------------------------------
'
Private Sub f1030_Change()
    On Error GoTo EH
    
    Call NumericOnly(f1030, True)
    Call CheckLength(f1030, 16)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f1030_Change"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1030_LostFocus()
' DateTime  : 3/16/2004
' Purpose   : Commodity Unit Value is formatted to 6 decimal places then Customs Value
'             calculated.
'---------------------------------------------------------------------------------------
'
Private Sub f1030_LostFocus()
    On Error GoTo EH
    
    Call CalcCustomsValue
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f1030_LostFocus"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f116_Change()
' DateTime  : 3/16/2004
' Purpose   : Num of Pkgs is numeric, no decimal allowed.
'---------------------------------------------------------------------------------------
'
Private Sub f116_Change()
    Dim i As Integer
    
    On Error GoTo EH
    
    Call NumericOnly(f116, False)
    Call AfterLostFocus(f116)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f116_Change"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1273_Click()
' DateTime  : 7/22/2005
' Purpose   : Default Admissibility pkg type to "BOX" when 01 as pkg type and US to CA
'             or CA to US.
'---------------------------------------------------------------------------------------
'
Private Sub f1273_Click()
    If Left(f1273, 2) = "01" And ((g_str117 = "US" And Left(f50, 2) = "CA") Or (g_str117 = "CA" And Left(f50, 2) = "US")) Then
        f1958.Visible = True
        f1958 = "BOX"
        'f1958.SetFocus
        f1273.Width = 1575
        ' StatusBar1.Panels(2) = "Please select Admissibility Pkg Type"
    Else
        f1958.Visible = False
        f1958 = ""
        f1273.Width = 3315
        StatusBar1.Panels(2) = ""
    End If
    If Len(f1273.Text) >= 2 Then
        Call AfterLostFocus(f1273)
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1331_Click()
' DateTime  : 8/22/2005
' Purpose   : If not Ground show IDG/ADG form if neither has been selected.
'---------------------------------------------------------------------------------------
'
Private Sub f1331_Click(Index As Integer)
    If Left(f1274, 2) <> "92" And Left(f1274, 3) <> "111" And f1331(Index) = 1 Then
        With frmDG
            If .optADG = False And .optIDG = False Then
                frmDG.Show vbModeless, Me
            End If
        End With
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f17_LostFocus()
' DateTime  : 9/8/2005
' Purpose   : If Auto Verify is checked on Verify Address menu addr verification is called
'---------------------------------------------------------------------------------------
'
Private Sub f17_LostFocus()
    If f17 <> "" And (Left(f50, 2) = "CA" Or Left(f50, 2) = "US") Then
        Call LoadCity(f15, f16, f17, f50)
    End If
    If mnuAutoVerify.Checked And wscFXRS.State = 7 And f17 <> "" And Left(f50, 2) = "US" Then
        SendData BuildAddrVerifyTrans(f11, f13, f14, f15, Left(f16, 2), Left(f17, 5), Left(frmShip.f50, 2))
        StatusBar1.Panels(2) = "Validating Address, please wait..."
        StatusBar1.Panels(3) = ""
        Call frmVerifyAddress.SetShipFieldsBackColor(vbWhite, False)
        DisableButtons
    End If
End Sub

'---------------------------------------------------------------------------------------
' Procedure : f1958_Change()
' DateTime  : 7/22/2005
' Purpose   : Show entire text of combo selection
'---------------------------------------------------------------------------------------
'
Private Sub f1958_Change()
    If Len(f1958) >= 3 Then
        Call SetComboSelection(f1958, f1958)
    End If
    Call SetEmptyBackcolor(f1958)
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1958_Click()
' DateTime  : 7/25/2005
' Purpose   : Set highlight backcolor if blank
'---------------------------------------------------------------------------------------
'
Private Sub f1958_Click()
    Call SetEmptyBackcolor(f1958)
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1958_LostFocus()
' DateTime  : 7/25/2005
' Purpose   : Clears the status bar after lost focus if field not blank
'---------------------------------------------------------------------------------------
'
Private Sub f1958_LostFocus()
    ' StatusBar1.Panels(2) = IIf(f1958 = "", "Please select Admissibility Pkg Type", "")
End Sub

Private Sub f414_LostFocus()
    Call AfterLostFocus(f414)
End Sub

'---------------------------------------------------------------------------------------
' Procedure : f440_Click()
' DateTime  : 8/22/2005
' Purpose   : Call routine to enable/disable ISR on frmSiqReq.
'---------------------------------------------------------------------------------------
'
Private Sub f440_Click()
    Call frmSigReq.SetAvailableSigRegOptions
End Sub

Private Sub f75_Change()

    Call AfterLostFocus(f75)
    
End Sub

'---------------------------------------------------------------------------------------
' Procedure : f78_Change()
' DateTime  : 5/5/2005
' Purpose   : Customs Value is numeric with decimal allowed and a max length of 12.
'---------------------------------------------------------------------------------------
'
Private Sub f78_Change()
    On Error GoTo EH
    
    Call NumericOnly(f78, True)
    Call CheckLength(f78, 12)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f78_Change"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f78_LostFocus()
' DateTime  : 5/5/2005
' Purpose   : Customs Value is numeric with decimal allowed and a max length of 12.
'---------------------------------------------------------------------------------------
'
Private Sub f78_LostFocus()
    On Error GoTo EH
    
    Call CalcUnitValue
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f78_LostFocus"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1273_Change()
' DateTime  : 8/9/2004
' Purpose   : Calls a routine to populate the entire text of selected pkg type.
'---------------------------------------------------------------------------------------
'
Private Sub f1273_Change()
    
    If Len(f1273) >= 2 Then
        Call SetComboSelection(f1273, f1273)
        Call AfterLostFocus(f1273)
    End If

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1274_Change()
' DateTime  : 3/16/2004
' Modified  : 3/13/2006 Removed code enabling/disabling chkEmailAlert
' Purpose   : Service type field - if length is greater than 2 then enable Email button
'             and call ShowSpecialSvcs.
'---------------------------------------------------------------------------------------
'
Private Sub f1274_Change()
    On Error GoTo EH
    
    If Len(f1274) >= 2 Then
        Call SetComboSelection(f1274, f1274)
    
        If Left(f1274, 2) = "90" Or Left(f1274, 2) = "92" Then
            Call SetComboSelection(f1273, "01")
            frmShip.f1273.Enabled = False
        Else
            frmShip.f1273.Enabled = True
        End If
    
    End If
    
    Call AfterLostFocus(f1274)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f1274_Change"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1274_Click()
' DateTime  : 3/16/2004
' Modified  : 3/13/2006 Removed code enabling/disabling chkEmailAlert
' Purpose   : Service type field - if length is greater than 2 then enable Email button
'             and call ShowSpecialSvcs.
'---------------------------------------------------------------------------------------
'
Private Sub f1274_Click()
    On Error GoTo EH
    
    If Len(f1274) >= 2 Then
        Call ShowSpecialSvcs
        Call SetLogo
        Call LoadPaymentTypeCombo(f23)
        '20071002-01 Added for SP to PR
        Call DomIntlScreenLayout
    
        If Left(f1274, 2) = "90" Or Left(f1274, 2) = "92" Then
            Call SetComboSelection(f1273, "01")
            frmShip.f1273.Enabled = False
        Else
            frmShip.f1273.Enabled = True
        End If
    
    End If
    
    Call AfterLostFocus(f1274)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f1274_Click"

End Sub

'---------------------------------------------------------------------------------------
' Procedure : f16_Change(), f16_Click
' DateTime  : 7/13/2004
' Purpose   : If state code is PR, call routine to update to Intl screen
'---------------------------------------------------------------------------------------
'
Private Sub f16_Change()
    On Error GoTo EH

    If Len(f16) >= 2 Then
        Call SetComboSelection(f16, f16)
    End If
        
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f16_Change"

End Sub
Private Sub f16_Click()
    On Error GoTo EH

    If Left(f16, 2) = "PR" Then
        Call DomIntlScreenLayout
        Call LoadServices(Left(f1274, 2))
        Call LoadPackaging(Left(f1273, 2))
        Call ShowSpecialSvcs
    End If

    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f16_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f24_Change
' DateTime  : 10/6/2004
' Purpose   : Highlights the Ship Date field if Future Day Shipping
'---------------------------------------------------------------------------------------
'
Private Sub f24_Change()
        
    If IsDate(f24) Then
        If DateDiff("d", Date, CDate(f24)) > 0 Then
            f24.BackColor = &HC0E0FF
        ElseIf DateDiff("d", Date, CDate(f24)) < 0 Then
            '03/16/06 no longer change to today's date if date is prior to today
            'Just change background to red.
            f24.BackColor = 255
        Else
            f24.BackColor = &HFFFFFF
        End If
        
        'Added 2/2/05 to support future day IPD
        If Left(f1274.Text, 2) = "18" Then
            Call LoadIORCombo(frmSetup.f10, f24)
        End If
        
        '04/06/06 Added for mode optimization
        If txtDelDate.Enabled Then Call SetDelDateBkGrnd
   End If

    If txtShipDate.Text <> f24.Text Then
        txtShipDate.Text = f24.Text
    End If

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f25_Change
' DateTime  : 4/8/2005
' Purpose   : Allow only 20 characters for SmartPost references
'---------------------------------------------------------------------------------------
'
Private Sub f25_Change()
    If Left(f1274, 2) = "99" Then
        Call CleanSPRef(f25)
        Call CheckLength(f25, 20)
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f3057_Change
' DateTime  : 4/8/2005
' Purpose   : Allow only 10 characters for SmartPost Inv#. Used as Billing number in
'             Detail Record.
'---------------------------------------------------------------------------------------
'
Private Sub f3057_Change()
    If Left(f1274, 2) = "99" Then
        Call CheckLength(f3057, 10)
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f17_Change()
' DateTime  : 3/16/2004
' Purpose   : Recipient ZIP has a max length of 10
'---------------------------------------------------------------------------------------
'
Private Sub f17_Change()
    On Error GoTo EH
    
    Call CheckLength(f17, 10)
    
    Set m_objAddressEditControl = f17
    
    Call AfterLostFocus(f17)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f17_Change"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f18_Change()
' DateTime  : 3/16/2004
' Purpose   : Recipient phone # is numeric with max length of 15.
'---------------------------------------------------------------------------------------
'
Private Sub f18_Change()
    On Error GoTo EH
    
    Call NumericOnly(f18, False)
    Call CheckLength(f18, 15)
    
    Set m_objAddressEditControl = f18

    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f18_Change"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f20_Change()
' DateTime  : 3/16/2004
' Purpose   : Acct# is numeric with max length of 9
'---------------------------------------------------------------------------------------
'
Private Sub f20_Change()
    On Error GoTo EH
    
    Call SetEmptyBackcolor(f20)
    Call NumericOnly(f20, False)
    Call CheckLength(f20, 9)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f20_Change"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f20_LostFocus()
' DateTime  : 3/16/2004
' Purpose   : Validate Billing acct# and give error if not valid. If blank, set acct#
'             back to Bill Shipper and set focus on Billing Type field.
'---------------------------------------------------------------------------------------
'
Private Sub f20_LostFocus()
    On Error GoTo EH
    
    If Not AcctNumCheckOK(f20) Then
        f20.BackColor = &HC0E0FF
        If f20 <> "" Then
            MsgBox "Invalid FedEx Account Number", vbExclamation, "Ship Error"
            '10/6/05 only set focus If locked
            If f20.Enabled Then f20.SetFocus
        End If
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f20_LostFocus"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1670_Change()
' DateTime  : 3/16/2004
' Purpose   : Weight field is numeric, allow decimal.
'---------------------------------------------------------------------------------------
'
Private Sub f1670_Change()
    On Error GoTo EH
    Static dblf1670 As Double
    
    Call NumericOnly(f1670, True)
    Call AfterLostFocus(f1670)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f1670_Change"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1670_GotFocus()
' DateTime  : 3/16/2004
' Purpose   : Weight field, if configured for a scale, read the weight. Set return label
'             weight field.
'---------------------------------------------------------------------------------------
'
Private Sub f1670_GotFocus()
    On Error GoTo EH
    Dim strWeight As String
    
    With frmSetup
        If .chkScaleConnected = 1 Then
            strWeight = ReadScale(Right(.cmbScalePort, 1), Left(.cboProtocol, 1))
            If IsNumeric(strWeight) Then
                If Val(strWeight) > 0 Then
                    f1670.Text = strWeight
                    If IsNumeric(f1670.Text) Then
                        If Val(f1670.Text) > 0 Then
                            If g_strScaleMeasure <> "" Then
                                f75.Text = g_strScaleMeasure
                            End If
                        End If
                    End If
                Else
                    Call SelectAllText(f1670)
                End If
            Else
                Call SelectAllText(f1670)
            End If
        Else
            Call SelectAllText(f1670)
        End If
    End With
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f1670_GotFocus"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f23_Change()
' DateTime  : 8/9/2004
' Purpose   : Calls a routine to populate the entire text of selected payment type.
'---------------------------------------------------------------------------------------
'
Private Sub f23_Change()
    If Len(f23) >= 1 Then
        Call SetComboSelection(f23, f23)
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f23_Click()
' DateTime  : 3/16/2004
' Purpose   : Billing Type if 2 or 3 are selected highlight Billing Acct# field, and
'             set focus to it, else disable acct# field.
'---------------------------------------------------------------------------------------
'
Private Sub f23_Click()
    On Error GoTo EH
    
    '01/10/06 Added LTL BOL
    If Left(f23, 1) <> "1" And Left(f1274, 2) <> "92" And Left(f1274, 2) <> "90" And Left(f1274, 3) <> "111" Then
        f20.Enabled = True
        If Len(f20) = 0 Then
            f20.BackColor = &HC0E0FF
            '10/6/05 only set focus If locked
            If f20.Enabled Then f20.SetFocus
        End If
    ElseIf (Left(f23, 1) = "3" Or Left(f23, 1) = "5") And (Left(f1274, 2) = "92" Or Left(f1274, 2) = "90") Then
        f20.Enabled = True
        If Len(f20) = 0 Then
            f20.BackColor = &HC0E0FF
            '10/6/05 only set focus If locked
            If f20.Enabled Then f20.SetFocus
        End If
    Else
        f20.Enabled = False
        f20 = ""
        f20.BackColor = &HFFFFFF
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f23_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f26_Change()
' DateTime  : 3/16/2004
' Purpose   : Delcared Value is numeric only, no decimals.
'---------------------------------------------------------------------------------------
'
Private Sub f26_Change()
    On Error GoTo EH
    
    Call NumericOnly(f26, False)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f26_Change"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f27_Click(index As Integer)
' DateTime  : 3/16/2004
' Purpose   : COD Flag if checked chkDuplicate is cleared and disabled
'---------------------------------------------------------------------------------------
'
Private Sub f27_Click(Index As Integer)
    On Error GoTo EH
    
    If Index <> 2 Then
        If f27(Index) Then
            chkDuplicate = 0
            chkDuplicate.Enabled = False
            chkDuplicate.Visible = chkDuplicate.Enabled
        Else
            If Not optCommodities Then
                chkDuplicate.Enabled = True
                chkDuplicate.Visible = chkDuplicate.Enabled
            End If
        End If
    End If
    
    If f27(Index).Value = 1 Then
        Call cmdViewCOD_Click(Index)
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f27_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f3020_Click
' DateTime  : 3/16/2004
' Purpose   : FHD Special svcs. If one is selected the others are disabled. Sig Svc is
'             disabled if Appt Del is selected.
'---------------------------------------------------------------------------------------
'
Private Sub f3020_Click(Index As Integer)
    Dim i As Integer
    
    On Error GoTo EH
    
    For i = 0 To 2
        If f3020(Index) <> 1 Or i = Index Then
            f3020(i).Enabled = True
        Else
            f3020(i).Enabled = False
        End If
    Next
    If Index = 2 Then
        If f3020(2) = 1 Then
            f1208(1) = 0
            f1208(1).Enabled = False
            cmdViewSigReq(1).Enabled = False
        Else
            f1208(1).Enabled = True
            cmdViewSigReq(1).Enabled = True
        End If
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f3020_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f38_LostFocus
' DateTime  : 2/21/2005
' Purpose   : Calls hook to run after department field loses focus
'---------------------------------------------------------------------------------------
'
Private Sub f38_LostFocus()
    Call AfterLostFocus(f38)
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f414_KeyPress
' DateTime  : 2/23/2005
' Purpose   : Call routine to search combo
'---------------------------------------------------------------------------------------
'
Private Sub f414_KeyPress(KeyAscii As Integer)
    Call SearchCombo(f414, KeyAscii)
    Call AfterLostFocus(f414)
End Sub

'---------------------------------------------------------------------------------------
' Procedure : f50_Change()
' DateTime  : 3/16/2004
' Purpose   : After Country is at least 2 characters call routines to set populate
'             the selection text.
'---------------------------------------------------------------------------------------
'
Private Sub f50_Change()
    On Error GoTo EH
    
    If Len(f50) >= 2 Then
        Call SetComboSelection(f50, f50)
        
        If Left(f50, 2) <> "US" And f1482 = 1 Then
            f1482 = 0
        End If
    
    End If
    
    Set m_objAddressEditControl = f50
    
    Call AfterLostFocus(f50)

    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f50_Change"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f50_Click()
' DateTime  : 1/27/2005
' Purpose   : After Country is selected call routines to set screen fields
'---------------------------------------------------------------------------------------
'
Private Sub f50_Click()
    On Error GoTo EH
        
    If Left(f50, 2) <> "US" And f1482 = 1 Then
        f1482 = 0
    End If
    
    Call DomIntlScreenLayout
    Call LoadServices(Left(f1274, 2))
    Call LoadPackaging(Left(f1273, 2))
    Call ShowSpecialSvcs
    If Left(f50, 2) = "US" Then
        Call LoadStates(f16, f16)
    ElseIf Left(f50, 2) = "CA" Then
        Call LoadProvinces(f16, f16)
    ElseIf Left(f50, 2) = "MX" Then
        Call LoadMXStates(f16, f16)
    Else
        f16.Clear
    End If
    
    '02/17/06 Addded to disable Address Verification for non-US countries
    If Left(f50, 2) <> "US" And Left(f50, 2) <> "CA" Then
        mnuAutoVerify.Enabled = False
        frmShip.mnuShowVerifyForm.Enabled = False
    Else
        mnuAutoVerify.Enabled = True
        frmShip.mnuShowVerifyForm.Enabled = True
    End If
    
    Set m_objAddressEditControl = f50
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f50_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : DomIntlScreenLayout()
' DateTime  : 1/27/2005
' Purpose   : Call routines to set the screen fields for Domestic or Intl
' Call from : f50_Change(), f50_Click()
'---------------------------------------------------------------------------------------
'
Public Sub DomIntlScreenLayout()
        
    On Error GoTo EH
     
    If Left(frmSetup.f117, 2) = "CA" And f1482 = 0 Then
        Call SetCAScreen
    Else
        Call SetUSScreen
    End If
        
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:DomIntlScreenLayout"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : SetUSScreen()
' DateTime  : 1/27/2005
' Purpose   : Set the screen fields for Domestic or Intl
' Call from : DomIntlScreenLayout()
'---------------------------------------------------------------------------------------
'
Private Sub SetUSScreen()
    
    On Error GoTo EH
    
    Dim strProvTemp As String
        '20071002-01 Added statement after Or for SP to PR
    If f1482 = 0 And ((Left(f50, 2) = "US" And Left(f16, 2) <> "PR") Or (Left(f1274, 2) = "99" And (Left(f16, 2) = "PR" Or Left(f50, 2) = "PR"))) Then
        'Disable Intl tab
        If f1482 = 0 Then
            SSTab1.TabEnabled(1) = False
        End If
        
        '7/22/05 Disable Admissibility pkg type
        f1958.Visible = False
        
        '04/05/06 Disable duplicates for all Int'l shipments
        chkDuplicate.Enabled = True
        chkDuplicate.Visible = chkDuplicate.Enabled
        
        'Change captions for wgt and DV
        lblWeight.Caption = "Package Weight:"
        lblDecVal.Caption = "Declared Value:"
        lblDecVal.FontBold = False
        
        'Change label to state and make bold
        lblState = "State:"
        lblState.FontBold = True
        
        'Clear wgt type and load only LBS
        f75.Clear
        f75.AddItem "LBS"
        
        'Clear currency type and load only USD
        f68.Clear
        f68.AddItem "USD"
        
        'Hide Intl Doc and Commodities option buttons
        'optDocument.Visible = False
        'optCommodities.Visible = False
        ' 2008-04-09, JFW
        frameIntl.Visible = False
        
        'Make Identical pkgs checkbox visible
        chkDuplicate.Enabled = IIf(chkIPD = 0 And frmSetup.chkShipTab(15) = 0, True, False)
        chkDuplicate.Visible = chkDuplicate.Enabled
        
        lbl1355.Visible = False
        f1355.Visible = False
        chkIPD.Value = 0
        chkIntlIPD.Value = 0
    Else
        'Enable Intl Tab
        SSTab1.TabEnabled(1) = True
        
        '04/05/06 Disable duplicates for all Int'l shipments
        chkDuplicate.Enabled = False
        chkDuplicate.Visible = chkDuplicate.Enabled
        
        'Change Weight and Declared Value Labels
        lblWeight.Caption = "Shipment Weight:"
        lblDecVal.Caption = "Carriage Value:"
        ' 2011-12-22, JFW, Only some countries require
        ' lblDecVal.FontBold = True
        
        'Add KGS to Weight Type
        f75.Clear
        f75.AddItem "LBS"
        f75.AddItem "KGS"
        
        'Add Intl Currency Types to Declared Value
        f68.Clear
        Call LoadCurrencies(f68)
        
        'Make the Intl radio buttons visible
        'optDocument.Visible = True
        'optCommodities.Visible = True
        'optCommodities.Value = True
        ' 2008-04-09, JFW
        frameIntl.Visible = True
        
        '4/26/06 -If not PR, CA, or MX save the province, clear US states, then restore province
        If Left(f16, 2) <> "PR" And Left(f50, 2) <> "CA" And Left(f50, 2) <> "MX" Then
            strProvTemp = f16
            f16.Clear
            f16 = strProvTemp
        '4/26/06 Removed else if that set chkIPD = 0 and hid the IOR Facility combo
        End If
        
        'Change state label and turn off bold
        lblState = "State:"
        lblState.FontBold = False
        
        'Make Identical pkgs checkbox grayed
        chkDuplicate.Enabled = False
        chkDuplicate.Visible = chkDuplicate.Enabled
    End If
    f75 = "LBS"
    f68 = "USD"
    f1090 = "USD"

    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:SetUSScreen"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : SetCAScreen()
' DateTime  : 1/27/2005
' Purpose   : Set the screen fields for Intra-Canadian or Canadian Export
' Call from : DomIntlScreenLayout()
'---------------------------------------------------------------------------------------
'
Private Sub SetCAScreen()
    
    On Error GoTo EH
    
    Dim strProvTemp As String
    
    'Load both LBS and KGS in weight type
    f75.Clear
    f75.AddItem "LBS"
    f75.AddItem "KGS"
    chkIPD.Value = 0
    ' chkIntlIPD.Value = 0
    
    If Left(f50, 2) = "CA" Then
        'Disable Intl tab
        SSTab1.TabEnabled(1) = False
        
        '7/22/05 Disable Admissibility pkg type
        f1958.Visible = False
        
        'Change captions for wgt and DV
        lblWeight.Caption = "Package Weight:"
        lblDecVal.Caption = "Declared Value:"
        lblDecVal.FontBold = False
        
        'Change label to state and make bold
        lblState = "Prov:"
        lblState.FontBold = True
        
        'Hide Intl Doc and Commodities option buttons
        'optDocument.Visible = False
        'optCommodities.Visible = False
        ' 2008-04-09, JFW
        frameIntl.Visible = False
        
        'Make Identical pkgs checkbox visible
        ' 2011-05-03, JFW, Not for Canada
        chkDuplicate.Enabled = False
        chkDuplicate.Visible = chkDuplicate.Enabled
        
        lbl1355.Visible = False
        f1355.Visible = False
        
    Else
        'Enable Intl Tab
        SSTab1.TabEnabled(1) = True
        
        'Change Weight and Declared Value Labels
        lblWeight.Caption = "Shipment Weight:"
        lblDecVal.Caption = "Carriage Value:"
        ' 2011-12-22, JFW, Only some countries require
        ' lblDecVal.FontBold = True
        
        'Make the Intl radio buttons visible
        'optDocument.Visible = True
        'optCommodities.Visible = True
        'optCommodities.Value = True
        ' 2008-04-09, JFW
        frameIntl.Visible = True
        
        'If Non US destination save f16, clear, then restore the value
        If Left(f50, 2) <> "US" Then
            strProvTemp = f16
            f16.Clear
            f16 = strProvTemp
            'Change state label and turn off bold
            lblState = "Region:"
            lblState.FontBold = False
        Else
            'Change state label and turn off bold
            lblState = "State:"
            lblState.FontBold = False
        End If
                
        'Make Identical pkgs checkbox grayed
        chkDuplicate.Enabled = False
        chkDuplicate.Visible = chkDuplicate.Enabled
        
        lbl1355.Visible = True
        f1355.Visible = True
        
    End If
    
    f75 = "LBS"
    'Add Intl Currency Types to Declared Value
    f68.Clear
    Call LoadCurrencies(f68)
    
        'debugprint "1090 " & f1090.Text
        If Left(f50.Text, 2) = "CA" Then
            f68.Text = "CAD"
            f1090.Text = "CAD"
        ElseIf Left(f50.Text, 2) = "US" Then
            If f68.Text = "" Then
                f68.Text = "USD"
            End If
            If f1090.Text = "" Then
                f1090.Text = "USD"
            End If
        Else
            If f68.Text = "" Then
                f68.Text = "CAD"
            End If
            If f1090.Text = "" Then
                f1090.Text = "CAD"
            End If
        End If
        'debugprint "1090 " & f1090.Text
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:SetCAScreen"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f532_Change(), f532_Change(), f532_Change()
'             f532_LostFocus(), f532_LostFocus(), f532_LostFocus()
' DateTime  : 3/16/2004
' Purpose   : CI charges fields are numeric.
'---------------------------------------------------------------------------------------
'
Private Sub f532_Change()
    On Error GoTo EH
    
    Call NumericOnly(f532)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f532_Change"

End Sub
Private Sub f533_Change()
    On Error GoTo EH
    
    Call NumericOnly(f533)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f533_Change"

End Sub
Private Sub f534_Change()
    On Error GoTo EH
    
    Call NumericOnly(f534)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f534_Change"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f57_Change(), f58_Change(), f59_Change()
' DateTime  : 20080122-03
' Purpose   : Dimensions fields are a max length of 3.
'---------------------------------------------------------------------------------------
'
Private Sub f57_Change()
    On Error GoTo EH
    
    Call CheckLength(f57, 3)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f57_Change"

End Sub

Private Sub f57_LostFocus()
    
    If f57.Text <> Trim(f57.Text) Then f57.Text = Trim(f57.Text)
    If f57 = "" Then f57 = " H "

End Sub

Private Sub f58_Change()
    On Error GoTo EH
    
    Call CheckLength(f58, 3)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f58_Change"

End Sub

Private Sub f58_LostFocus()
    
    If f58.Text <> Trim(f58.Text) Then f58.Text = Trim(f58.Text)
    If f58 = "" Then f58 = " W "

End Sub
Private Sub f59_Change()
    On Error GoTo EH
    
    Call CheckLength(f59, 3)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f59_Change"

End Sub

Private Sub f59_LostFocus()
    
    If f59.Text <> Trim(f59.Text) Then f59.Text = Trim(f59.Text)
    If f59 = "" Then f59 = " L "

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f70_Click()
' DateTime  : 3/16/2004
' Purpose   : If Bill 3rd party selected for Duty/Taxes payor highlight Duty/taxes acct#
'             field and set focus to it.
'---------------------------------------------------------------------------------------
'
Private Sub f70_Click()
    On Error GoTo EH
    
    Select Case Left(f70, 1)
        Case "2"
            f71.Enabled = True
            f71.BackColor = &HFFFFFF
        Case "3"
            f71.Enabled = True
            f71.BackColor = &HC0E0FF
            '10/6/05 only set focus If locked
            If f71.Enabled Then f71.SetFocus
        Case Else
            f71.Enabled = False
            f71 = ""
    End Select
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f70_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f70_Change()
' DateTime  : 2/18/2005
' Purpose   : Calls a routine to populate the entire text of selected payment type.
'---------------------------------------------------------------------------------------
'
Private Sub f70_Change()
    If Len(f70) >= 1 Then
        Call SetComboSelection(f70, f70)
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f71_Change()
' DateTime  : 3/16/2004
' Purpose   : Duty taxes acct# is numeric with max length of 9.
'---------------------------------------------------------------------------------------
'
Private Sub f71_Change()
    On Error GoTo EH
    
    f71.BackColor = &HFFFFFF
    Call NumericOnly(f71, False)
    Call CheckLength(f71, 9)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f71_Change"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f71_LostFocus()
' DateTime  : 3/16/2004
' Purpose   : Duty/Taxes acct# - validate
'---------------------------------------------------------------------------------------
'
Private Sub f71_LostFocus()
    On Error GoTo EH
    
    If Not AcctNumCheckOK(f71) Then
        If f71 = "" And Left(f70, 1) = "3" Then
            f71.BackColor = &HC0E0FF
        ElseIf f71 = "" And Left(f70, 1) = "2" Then
            f71.BackColor = &HFFFFFF
        ElseIf f71 <> "" Then
            MsgBox "Invalid FedEx Account Number", vbExclamation, "Account Number Error"
            f71.BackColor = &HC0E0FF
            '10/6/05 only set focus If locked
            If f71.Enabled Then f71.SetFocus
        End If
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f71_LostFocus"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f72_Click()
' DateTime  : 10/29/2004
' Purpose   : Sets the current selection after the first number is entered
'---------------------------------------------------------------------------------------
'
Private Sub f72_Change()
    If Len(f72) >= 1 Then
        Call SetComboSelection(f72, f72)
    ElseIf Len(f72) >= 1 Then
        lblCI(1).Enabled = True
        lblCI(2).Enabled = True
        lblCI(1).FontBold = False
        lblCI(2).FontBold = False
    Else
        f532.Enabled = True
        f533.Enabled = True
        lblCI(1).Enabled = True
        lblCI(2).Enabled = True
        lblCI(1).FontBold = True
        lblCI(2).FontBold = True
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f72_Click()
' DateTime  : 3/16/2004
' Purpose   : Set the CI field allowed and required for different Terms of Sale values.
'---------------------------------------------------------------------------------------
'
Private Sub f72_Click()
    On Error GoTo EH
    
    Select Case Left(f72, 1)
        Case 2, 5, 6
            f532.Enabled = True
            f533.Enabled = True
            lblCI(1).Enabled = True
            lblCI(2).Enabled = True
            lblCI(1).FontBold = True
            lblCI(2).FontBold = True
        Case 3
            f532.Enabled = True
            f533.Enabled = False
            lblCI(1).Enabled = True
            lblCI(2).Enabled = False
            lblCI(1).FontBold = True
            lblCI(2).FontBold = False
        Case Else
            f532.Enabled = False
            f533.Enabled = False
            lblCI(1).Enabled = False
            lblCI(2).Enabled = False
            lblCI(1).FontBold = False
            lblCI(2).FontBold = False
    End Select
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f72_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f77_Change()
' DateTime  : 3/16/2004
' Purpose   : Weight is numeric, KGS allows decimal, LBS does not
'---------------------------------------------------------------------------------------
'
Private Sub f77_Change()
    On Error GoTo EH
    
    Call NumericOnly(f77, True)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f77_Change"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f80_Change()
' DateTime  : 1/27/2005
' Purpose   : After Country is at least 2 characters call routines to set populate
'             the selection text.
'---------------------------------------------------------------------------------------
'
Private Sub f80_Change(Index As Integer)
    
    If Len(f80(Index)) >= 2 Then
        Call SetComboSelection(f80(Index), f80(Index))
    End If

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f82_Change()
' DateTime  : 3/16/2004
' Purpose   : Number of units is numeric only
'---------------------------------------------------------------------------------------
'
Private Sub f82_Change()
    On Error GoTo EH
    
    Call NumericOnly(f82, False)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f82_Change"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : f82_LostFocus()
' DateTime  : 3/16/2004
' Purpose   : After Number of Units field loses focus calculate Customs Value and Weight
'---------------------------------------------------------------------------------------
'
Private Sub f82_LostFocus()
    On Error GoTo EH
    
    Call CalcCustomsValue
    Call CalcTotalWgt
    Call CalcUnitValue
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:f82_LostFocus"

End Sub

Private Sub Form_Activate()

    On Error GoTo ErrorExit
    
    If g_strTDMasterTrkNbr <> "" Then
        StatusBar1.Panels(2) = "TD MAWB # " & g_strTDMasterTrkNbr
    End If
    Call AfterScreenChange(Me)
    Exit Sub
    
ErrorExit:
    MsgBox Err.Description, vbCritical, "frmShip:Form_Activate"
End Sub

'---------------------------------------------------------------------------------------
' Procedure : Form_Initialize()
' DateTime  : 7/22/2004
' Purpose   : Use this sub to enable/disable optimization. Set g_blnAllowOptimize to True.
'             This makes the txtDelDate field and Calendar4 visible to allow Optimization.
'---------------------------------------------------------------------------------------
'
Private Sub Form_Initialize()

    On Error GoTo ErrorExit
    
    Call modCanada.ShipInitialize
    
    Exit Sub
    
ErrorExit:
    MsgBox Err.Description, vbCritical, "frmShip:Form_Activate"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : Form_KeyUp()
' DateTime  : 4/8/2004
' Purpose   : If F keys are pressed, run corresponding routines.
'             Note: The Track buttons F8 & F9 are called from the grdShipments_KeyUp
'             subroutine since they are only enabled when a record is selected in the
'             grid.
'---------------------------------------------------------------------------------------
'
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    On Error GoTo EH
    
    Dim i As Integer
    'Shift, Ctrl, and Alt aren't pressed
    If Shift = 0 Then
        Select Case KeyCode
            Case 112    'F1 Help
            Case 113    'F2 Custom1 button
                If cmdCustom(1).Visible = True Then Call CustomButton1
            Case 114    'F3 Custom2 button
                If cmdCustom(2).Visible = True Then Call CustomButton2
            Case 115    'F4 Custom3 button
                If cmdCustom(3).Visible = True Then Call CustomButton3
            Case 116    'F5 Clear
                If cmdMenu(0).Enabled = True Then Call ClearButton
            Case 117    'F6 Delete
                If cmdMenu(1).Enabled = True Then Call DeleteButton
            Case 118    'F7 Close
                If cmdMenu(2).Enabled = True Then Call CloseButton
            Case 122    'F11 Rate
                If cmdMenu(5).Enabled = True Then Call RateButton
            Case 123    'F12 Ship
                If cmdMenu(6).Enabled = True Then Call ShipButton
        End Select
    'CTRL key combinations
    ElseIf Shift = 2 Then
        Select Case KeyCode
            'CTRL-A - Toggles Address Book and interactive processing
            Case 65
                'Changed ToogleLookup to 2 different subs
                If True Then
                    If g_blnFormLoadComplete Then Call cmdMenu_Click(0)
                    If f1.Visible Then
                        Call SetLookup(False, Me)
                    ElseIf cboCustID.Visible Then
                        Call SetLookup(True, Me)
                    End If
                End If
'            'CTRL-D - Toggles Department Combo and Department text field
'            Case 68
'                Call ToggleDepartment
            'CTRL-I - Shows IPD Shipments form when IPD is enabled for an account
            Case 73
                If frmSetup.chkIPD = 1 Then
                    If g_frmIPD Is Nothing Then Set g_frmIPD = New frmIPD
                    g_frmIPD.Show vbModeless, Me
                End If
            'CTRL-R - Shows Setup form with only Alt Return Addr tab enabled to allow user to change current addr.
            Case 82
                With frmSetup
                    If .chkLevel2Access(10) = 1 Then
                        For i = 0 To .SSTab1.Tabs - 1
                            If i = 10 Then
                                .SSTab1.TabEnabled(i) = True
                            Else
                                .SSTab1.TabEnabled(i) = False
                            End If
                        Next
                        .Show vbModeless, Me
                        .SSTab1.Tab = 10
                        .cboAddrID.SetFocus
                    End If
                End With
            'CTRL-E - 20070613-01 Changed Auto Verify On/Off to CTRL-E from CTRL-V to allow users to use CTRL-V for pasting.
            Case 69
                StatusBar1.Panels(3) = IIf(mnuAutoVerify.Checked, "Auto Address Verify ON", "Auto Address Verify OFF")
            
            'Added 04/26/05 - [CTRL]-F1 thru [CTRL]-F12 as extra custom subs CICs can use in integrations
            'The sub-routines are in modCustomButtons
            Case 112    'F1
                Call CustomCTRLF1
            Case 113    'F2
                Call CustomCTRLF2
            Case 114    'F3
                Call CustomCTRLF3
            Case 115    'F4
                Call CustomCTRLF4
            Case 116    'F5
                Call CustomCTRLF5
            Case 117    'F6
                Call CustomCTRLF6
            Case 118    'F7
                Call CustomCTRLF7
            Case 119    'F8
                Call CustomCTRLF8
            Case 120    'F9
                Call CustomCTRLF9
            Case 121    'F10
                Call CustomCTRLF10
            Case 122    'F11
                Call CustomCTRLF11
            Case 123    'F12
                Call CustomCTRLF12
        End Select
    'CTRL-SHIFT key combinations 10/4/05
    ElseIf Shift = 3 Then
        'CTRL-SHIFT-D - Enable/Disable debugger
        If KeyCode = 68 Then
            If g_blnDebug Then
                g_blnDebug = False
                StatusBar1.Panels(2) = "Debug Disabled"
            Else
                frmDebugPassword.Show vbModeless, Me
            End If
        End If
    End If
    Me.Refresh
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:Form_KeyUp"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : Form_KeyDown()
' DateTime  : 2/17/2005
' Purpose   : Enter key pressed sends a TAB to move to next field
'---------------------------------------------------------------------------------------
'
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If Not TypeOf Me.ActiveControl Is CommandButton Then
        If Shift = 0 And KeyCode = 13 Then
            SendKeys "{TAB}"
        End If
    End If
End Sub
'---------------------------------------------------------------------------------------
' Module    : Form_Load()
' DateTime  : 3/16/2004
' Author    : Chris Elwell
' Purpose   : Set intial program settings.
'---------------------------------------------------------------------------------------
'
Private Sub Form_Load()
    
    Dim i As Integer
    
    On Error GoTo EH
    
    Set g_clsReg = New clsRegistryRoutines
    Set g_clsParser = New clsFXRSParser
    
    'Initialize booleans
    g_blnFormLoadComplete = False
    g_blnDeletesComplete = True
    
    
    'If Address Book was last used, toogle lookup fields
    With g_clsReg
        .hkey = HKEYTYPE
        .KeyRoot = MAINKEYROOT
        .Subkey = MAINSUBKEY
        If .GetRegistryValue("AddressBook", "1") Then
             Call SetLookup(False, Me)
        Else
             Call SetLookup(True, Me)
        End If
        If Screen.Width = 12000 Then
            Me.Width = Screen.Width
            Me.Height = Screen.Height
            Me.ScaleMode = 3
            
            '20070613-03 Show 800X600 message if registry setting is not no.
            If .GetRegistryValue("ShowScreenReductionMsg", "") <> "N" Then frmResizeNotice.Show
                
            Call ResizeAll(Me)
        End If
    End With
    
    'Custom routine that runs once declared in integration module
    ' 2008-10-01, JFW, Too early here.
    ' Call Initialize
    
    'Load currencies into f1090
    Call LoadCurrencies(f1090)
    
    'Populate cboBoxName combo
    Call LoadBoxDIMsCombos(cboBoxName)
    
    'Initialize Destination Countries combo
    Call LoadCountries(f50)
    'Initialize Country of Manufacture combos
    Call LoadCountries(f80(0))
    Call LoadCountries(f80(1))
    'Initialize Ulimate Destination Countries combo
    
    '02/07/06 Load FTR Exemptions
    Call LoadFTRExemptions(cbo1358)
    
    '06/01/06
     Call LoadDeptCombo(f38, f38)

    'Show Express logo, hide Ground logo
    imgLogo1.Visible = True
    imgLogo2.Visible = False
    
    'Set g_blnOptimize to True in Form_Initialize if you want to allow service optimization
    If g_blnAllowOptimize Then
        txtDelDate.Visible = True
        Image1.Visible = True
        lblShipDate.Caption = "Ship Date/Del Date:"
        lblShipDate.FontBold = True
    Else
        txtDelDate.Visible = False
        Image1.Visible = False
        lblShipDate.Caption = "Ship Date:"
        lblShipDate.FontBold = False
    End If
    
    'Default #pkgs to 1
    f116 = "1"

    'Ship date defaults to today
    f24.Text = Date
    Calendar1.Today
    Calendar4.Today
    txtShipDate = Date
    
    'Set calendar sizes
    Calendar1.Height = 2295 'Ship date - Ship Tab
    Calendar1.Width = 3015
    Calendar2.Height = 2475 'Export License expiration date - Intl Tab
    Calendar2.Width = 3195
    Calendar3.Height = 2295 'Ship Date - Shipping History Tab
    Calendar3.Width = 3015
    Calendar4.Height = 2295 'Deliver Date - Ship Tab
    Calendar4.Width = 3015
    
    'Disable MPS, Intl MPS Dims, and Add to Shipment (Intl tab) buttons until OrderID is entered
    cmdMPS.Enabled = False
    cmdAddToShipment.Enabled = False
    
    'Disable buttons that require FXRS connection
    Call DisableButtons
    'Disable Track buttons
    Call SetTrackButtons
    'Disable Abort Batch button until processing begins
    cmdAbortBatch.Enabled = False
    
    'Added 7/21 for CA
    Call LoadAdmissibilityPkgTypes(f1958)
    
    'Set Billing to Bill Recipient
    f23.ListIndex = 0
    
    ' 2010-07-21, JFW, A connection at this time doesn't work well when VPN.  Don't know why.  Moved to Timer1.
    'Connect to FXRS if Connect on Startup box checked in Setup
'    If frmSetup.chkConnectOnStartup = 1 Then
'        ' debugprint "frmShip", "Load", "calling ConnectFXRS"
'        Call ConnectFXRS
'    End If
    'Initialize package count
    g_intDupCount = 1
    
    'Populate Unit of Measure combo
    f414.AddItem "BBL - Barrel"
    f414.AddItem "BU - Bushel"
    f414.AddItem "C - Celsius"
    f414.AddItem "CAR - Carat"
    f414.AddItem "CFT - Cubic Feet"
    f414.AddItem "CG - Centigrams"
    f414.AddItem "CM - Centimeter"
    f414.AddItem "CM3 - Cubic Centimeters"
    f414.AddItem "DOZ - Dozen"
    f414.AddItem "DPR - Dozen Pair"
    f414.AddItem "E - Each"
    f414.AddItem "GAL - Gallon"
    f414.AddItem "GR - Gross"
    f414.AddItem "GRM - Gram"
    f414.AddItem "KG - Kilogram"
    f414.AddItem "L - Liter"
    f414.AddItem "LB - Pound"
    f414.AddItem "LFT - Linear Foot"
    f414.AddItem "LNM - Linear Meter"
    f414.AddItem "LTR - Liters"
    f414.AddItem "LYD - Linear Yard"
    f414.AddItem "M - Meter"
    f414.AddItem "M2 - Square Meters"
    f414.AddItem "M3 - Cubic Meters"
    f414.AddItem "MG - Milligrams"
    f414.AddItem "ML - Milliliters"
    f414.AddItem "NO - Number"
    f414.AddItem "OZ - Ounces"
    f414.AddItem "PCS - Pieces"
    f414.AddItem "PR - Pair"
    f414.AddItem "PRS - Pair of Pairs"
    f414.AddItem "SFT - Square Foot"
    f414.AddItem "SQI - Square Inch"
    f414.AddItem "SYD - Square Yard"
    f414.AddItem "YD - Yard"
    
    'Populate DocType combo
    f79Doc.AddItem "Birth Certificates"
    f79Doc.AddItem "Employment Papers"
    f79Doc.AddItem "Immigration Papers"
    f79Doc.AddItem "Income Statements"
    f79Doc.AddItem "Letters and Cards"
    f79Doc.AddItem "Marriage Certificates"
    f79Doc.AddItem "Marriage Licenses"
    f79Doc.AddItem "Medical Records"
    f79Doc.AddItem "Tax Papers"
    f79Doc.AddItem "Accounting Documents"
    f79Doc.AddItem "Analysis Reports"
    f79Doc.AddItem "Application for License"
    f79Doc.AddItem "Applications for Loans"
    f79Doc.AddItem "Bank Statements"
    f79Doc.AddItem "Bid Quotations"
    f79Doc.AddItem "Bills of Sale"
    f79Doc.AddItem "Bonds"
    f79Doc.AddItem "Budget Statements/Report"
    f79Doc.AddItem "Business Correspondence"
    f79Doc.AddItem "Checks"
    f79Doc.AddItem "Claim Files"
    f79Doc.AddItem "Closing Statements"
    f79Doc.AddItem "Conference Reports"
    f79Doc.AddItem "Contracts"
    f79Doc.AddItem "Cost Estimates"
    f79Doc.AddItem "Court Transcripts"
    f79Doc.AddItem "Credit Applications"
    f79Doc.AddItem "Customs Documents"
    f79Doc.AddItem "Data Sheets"
    f79Doc.AddItem "Escrow Instructions"
    f79Doc.AddItem "Export Papers"
    f79Doc.AddItem "Financial Statements"
    f79Doc.AddItem "Franchise Reports"
    f79Doc.AddItem "Hotel Reservations"
    f79Doc.AddItem "Insurance Documents"
    f79Doc.AddItem "Inter-office Memos"
    f79Doc.AddItem "Inventory Reports"
    f79Doc.AddItem "Invoices"
    f79Doc.AddItem "Leases"
    f79Doc.AddItem "Legal Documents"
    f79Doc.AddItem "Letter of Credit Doc."
    f79Doc.AddItem "Loan Documents"
    f79Doc.AddItem "Memorandums"
    f79Doc.AddItem "Office Records"
    f79Doc.AddItem "Operating Agreements"
    f79Doc.AddItem "Patent Applications"
    f79Doc.AddItem "Permits"
    f79Doc.AddItem "Photocopies (PIB docs)"
    f79Doc.AddItem "Price Lists"
    f79Doc.AddItem "Proposals"
    f79Doc.AddItem "Prospectus"
    f79Doc.AddItem "Purchase Orders"
    f79Doc.AddItem "Quotations"
    f79Doc.AddItem "Resumes"
    f79Doc.AddItem "Sales Agreements"
    f79Doc.AddItem "Sales Reports"
    f79Doc.AddItem "Shipping Documents"
    f79Doc.AddItem "Statistical Data"
    f79Doc.AddItem "Stock Information"
    f79Doc.AddItem "Trade Confirmations"
    f79Doc.AddItem "Transcripts"
    f79Doc.AddItem "Warranty Deeds"
    f79Doc.AddItem "Travel Agendas/Itinerary"
    f79Doc.AddItem "Travel Proposals"
    
    '8/24/05 removed checkbox from setup so just load commodities if there
    'are any in the Commodities table
    Call LoadCommodities
    
    'Set Shipping History defaults
    ' 2010-06-07, JFW, Not good default for CA origin
    ' cboShipmentType = "Express Domestic"
    cboShipmentType = "All"
    cboShipmentStatus = "Shipped"
    Call LoadSearchFields("Express Domestic")
    
    'Set Custom button properties
    Call frmSetup.SetCustomButtons
    
    'Select first Visible tab as default
    For i = 0 To SSTab1.Tabs - 1
        If SSTab1.TabVisible(i) = True Then
            SSTab1.Tab = i
            Exit For
        End If
    Next
    
    '02/28/06 Computer name to be used when saving records to multi-occurrence table
    g_strComputerName = Trim(GetSystemName)
    
    '05/10/06 Added to show Dimension in box
    f57 = " H "
    f58 = " W "
    f59 = " L "

    Call modCanada.ShipLoad

    g_strTDMasterTrkNbr = g_clsReg.GetRegistryValue("TDMasterShipmentID", "")
    If IsDate(g_clsReg.GetRegistryValue("TDMasterShipmentDate", #1/1/2006#)) Then
        g_dteTDDate = CDate(g_clsReg.GetRegistryValue("TDMasterShipmentDate", #1/1/2006#))
    End If
    g_strTDOpenShip = g_clsReg.GetRegistryValue("TDOpenShipIndex", "")
        
    Me.f83.Visible = False
    Me.f84.Visible = False
    Me.lblCommodity(12).Visible = False
    Me.Image3.Visible = False
    
        
    'Custom routine that runs once declared in integration module
    ' 2008-10-01, JFW, Moved to last so that combos are all set.
    Call Initialize(Me)
                    
    Exit Sub
EH:
     
    MsgBox Err.Description, vbCritical, "frmShip:Form_Load"
    
End Sub

'---------------------------------------------------------------------------------------
' Module    : Form_Unload
' DateTime  : 3/16/2004
' Author    : Chris Elwell
' Purpose   : Kill global objects, unload forms and end program
'---------------------------------------------------------------------------------------
'
Private Sub Form_Unload(Cancel As Integer)
        
    Dim frm As Form
    
    On Error Resume Next
    
    'Kill objects
    Set g_clsReg = Nothing
    Set g_clsParser = Nothing
    Set g_connFSMSClient = Nothing
    If m_rsHistory.State = adStateOpen Then m_rsHistory.Close
    Set m_rsHistory = Nothing
    
    ' 2009-03-25, JFW, No need to do this.  Recently causes problems.  Maybe I did something.  Maybe ActiveX Killbits.
    'Unload forms
'    For Each frm In Forms
'        Unload frm
'    Next
    
    End

End Sub

'---------------------------------------------------------------------------------------
' Procedure : grdShipments_Click()
' DateTime  : 5/24/2004
' Purpose   : Call SetTrackButton to enable/disable tracking buttons.
'---------------------------------------------------------------------------------------
'
Private Sub grdShipments_Click()
    On Error GoTo EH
    
    Call SetTrackButtons
    
    '02/20/06 Save row values
    m_intPrevious = m_intCurrent
    m_intCurrent = grdShipments.Row
    
    '02/20/06 If the Shift boolean is True and the current and previous rows are not equal
    'call routine to select range of rows and set boolean back to false.
    If m_blnShift And m_intPrevious <> m_intCurrent Then
        Call GridShiftSelect(grdShipments, m_intPrevious, m_intCurrent)
        m_blnShift = False
        m_intPrevious = 0
        m_intCurrent = 0
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:grdShipments_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : grdShipments_DblClick()
' DateTime  : 3/16/2004
' Purpose   : Verifies you're connected to FXRS before trying to delete from Shipments grid.
'---------------------------------------------------------------------------------------
'
Private Sub grdShipments_DblClick()
    Dim intAnswer As Integer
    Dim intRet As Integer
    
    On Error GoTo EH
    
    If wscFXRS.State <> 7 Then
        MsgBox "You must be connected to the FSMS to delete a package.", vbExclamation, "Delete Error"
    ElseIf cboShipmentStatus = "Shipped" Then
        'Verify
        If Left(cboShipmentType, 7) = "Express" Then
            If grdShipments.Columns("Master Trk #") <> "" And Right(cboShipmentType, 3) <> "IPD" Then
            
                intAnswer = MsgBox("Deleting an MPS tracking number will delete the entire shipment." & vbCrLf & _
                "Are you sure you want to delete this shipment?", vbYesNo, "Confirm Delete")
            Else
                intAnswer = MsgBox("Are you sure you want to delete tracking # " & grdShipments.Columns("Trk #") & "?", vbYesNo, "Confirm Delete")
            End If
        Else
            intAnswer = MsgBox("Are you sure you want to delete tracking # " & grdShipments.Columns("Trk #") & "?", vbYesNo, "Confirm Delete")
        End If
        If intAnswer = vbYes Then
            If cboShipmentType = "Express IPD" Then
                Call SendData(BuildCRNDeleteTrans(grdShipments.Columns("Trk #"), grdShipments.Columns("IOR Facility"), grdShipments.Columns("Country")))
            ElseIf Right(Trim(cboShipmentType), 3) = " TD" Then
                Call SendData(BuildTDCDeleteTrans(grdShipments.Columns("Trk #"), ""))
            ElseIf cboShipmentType = "SmartPost" Then
                intRet = DeleteSPPkg(grdShipments.Columns("Trk #"))
                Select Case intRet
                    Case 0
                        StatusBar1.Panels(2) = grdShipments.Columns("Trk #") & " Deleted!"
                        Call Pause(1)
                        Call WriteDelete(grdShipments.Columns("Trk #"))
                        Call UpdateShipmentsGrid("SmartPost", "Shipped")
                    Case 1
                        Call WriteDelete(grdShipments.Columns("Trk #"))
                        MsgBox grdShipments.Columns("Trk #") & " has already been deleted.", vbExclamation, "Delete Error"
                        StatusBar1.Panels(2) = "Deleted Error!"
                    Case 2
                        MsgBox grdShipments.Columns("Trk #") & " has already been manifested.", vbExclamation, "Delete Error"
                        StatusBar1.Panels(2) = "Deleted Error!"
                End Select
            Else
                Call SendData(BuildDeleteTrans(grdShipments.Columns("Trk #")))
            End If
        End If
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:grdShipments_DblClick"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : grdShipments_KeyDown()
' DateTime  : 3/16/2004
' Purpose   : Call trk by trk# or trk by reference when F8 or F9 pressed
'---------------------------------------------------------------------------------------
'
Private Sub grdShipments_KeyDown(KeyCode As Integer, Shift As Integer)
    On Error GoTo EH

    Select Case KeyCode
        Case 117    'F6 Delete
            If cmdMenu(1).Enabled = True Then Call DeleteButton
        Case 119
            If cmdMenu(3).Enabled = True Then Call TrackIt(grdShipments.Columns("Trk #"))
        Case 120
            If cmdMenu(4).Enabled = True Then Call RefTrackButton
    End Select
    
    '02/20/06 If Shift key pressed set boolean to True
    If Shift = 1 And KeyCode = 16 Then
        m_blnShift = True
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:grdShipments_KeyDown"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : grdShipments_HeadClick()
' DateTime  : 6/8/2004
' Purpose   : Sort by column when heading clicked
'---------------------------------------------------------------------------------------
'
Private Sub grdShipments_HeadClick(ByVal ColIndex As Integer)

    On Error GoTo EH

    m_blnSortOrder = IIf(m_intLastColumnSort = ColIndex, Not m_blnSortOrder, True)
    
    'If a search has been performed sort only searched records
    If txtSearchValue <> "" Then
        Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus, cboSearchField, txtSearchValue, grdShipments.Columns(ColIndex).Caption, IIf(m_blnSortOrder, "ASC", "DESC"))
    Else
        Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus, , , grdShipments.Columns(ColIndex).Caption, IIf(m_blnSortOrder, "ASC", "DESC"))
    End If
    
    m_intLastColumnSort = ColIndex
    
    Exit Sub

EH:
     MsgBox Err.Description, vbCritical, "frmShip:grdShipments_HeadClick"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : Image1_Click()
' DateTime  : 7/22/2004
' Purpose   : Show calendar for Del Date (Optimization only).
'---------------------------------------------------------------------------------------
'
Private Sub Image1_Click()
    Calendar4.Visible = True
End Sub

'---------------------------------------------------------------------------------------
' Procedure : Image3_Click()
' DateTime  : 3/16/2004
' Purpose   : Show calendar for Export License Expiration Date.
'---------------------------------------------------------------------------------------
'
Private Sub Image3_Click()
    Calendar2.Visible = True
End Sub
'---------------------------------------------------------------------------------------
' Procedure : Image4_Click()
' DateTime  : 3/22/2004
' Purpose   : Show calendar for ShipDate on Shipped List tab.
'---------------------------------------------------------------------------------------
'
Private Sub Image4_Click()
    Calendar3.Visible = True
End Sub

Private Sub Label1_DblClick(Index As Integer)

    If Index = 1 Then
        If f1.Visible Then
            Call SetLookup(False, Me)
        ElseIf cboCustID.Visible Then
            Call SetLookup(True, Me)
        End If
    End If
    
End Sub

Private Sub lblMoreCommodity_Click()

    Dim rsCommodity As ADODB.Recordset
    Dim strQuery As String
    
    If g_frmCommodityMore Is Nothing Then
        If cboCommodityID.Text <> "" Then
            Set rsCommodity = New ADODB.Recordset
            strQuery = "SELECT * FROM Commodity WHERE CommodityID = " & SingleQuotes(cboCommodityID.Text)
            rsCommodity.Open strQuery, g_connFSMSClient, adOpenKeyset, adLockOptimistic
        End If
        Set g_frmCommodityMore = New frmCommodityMore
        If Not rsCommodity Is Nothing Then
            If Not rsCommodity.EOF Then
                g_frmCommodityMore.cboMID.Text = rsCommodity!Mid
                g_frmCommodityMore.cboDocument1.Text = rsCommodity!Document1
                g_frmCommodityMore.cboDocument2.Text = rsCommodity!Document2
                g_frmCommodityMore.cboDocument3.Text = rsCommodity!Document3
            End If
        End If
    End If
    g_frmCommodityMore.Show 0
    
End Sub

Private Sub lblMoreLTL_Click()
    frmBOL.Show vbModeless, Me
End Sub

'---------------------------------------------------------------------------------------
' Procedure : lstErrorTransactions_DblClick()
' DateTime  : 3/22/2004
' Updated   : 8/18/2004
' Modified  : Added If statement to only do batch edit if Ship form is enabled.
' Purpose   : Calls BatchErrorEdit which displayed the error batch transaction on the Ship
'             for editing. Then remove the item from the error list.
'---------------------------------------------------------------------------------------
'
Private Sub lstErrorTransactions_DblClick()
    'On Error GoTo EH
    
    With lstErrorTransactions
        If SSTab1.TabVisible(0) = True Then
            f1 = ""
            g_blnBatchEdit = True
            Call BatchErrorEdit(.Text)
            .RemoveItem (.ListIndex)
            .ToolTipText = "Double-click a line to process on Ship screen."
            
            SSTab1.Tab = 0
        Else
            .ToolTipText = ""
        End If
    End With
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:lstErrorTransactions_DblClick"

End Sub

Private Sub mnuAddressBook_Click()
    Call ShowImportForm(False)
    frmImport.Caption = "Import Addresses"
End Sub

Private Sub mnuAddressBookEdit_Click()
    frmAddressEdit.Show vbModeless, Me
End Sub

Private Sub mnuAltReturnAddr_Click()
    Call ShowImportForm(False)
    frmImport.Caption = "Import Alternate Return Addresses"
End Sub

Private Sub mnuAltReturnAddrEdit_Click()
    frmAltReturnAddrEdit.Show vbModeless, Me
End Sub

Private Sub mnuAutoVerify_Click()
    
    mnuAutoVerify.Checked = IIf(mnuAutoVerify.Checked = True, False, True)
    'Save setting to registry
    g_clsReg.SetRegistryValue "AutoAddrVerify", frmShip.mnuAutoVerify.Checked, REG_SZ
        
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuCommodities_Click()
' DateTime  : 3/25/2004
' Purpose   : Shows the Commodity Import form.
'---------------------------------------------------------------------------------------
'
Private Sub mnuCommodities_Click()
    Call ShowImportForm(False)
    frmImport.Caption = "Import Commodities"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuCommoditiesEdit_Click()
' DateTime  : 3/25/2004
' Purpose   : Shows the Commodity Add/Edit/Delete form.
'---------------------------------------------------------------------------------------
'
Private Sub mnuCommoditiesEdit_Click()
    frmCommoditiesEdit.Show vbModeless, Me
End Sub

'---------------------------------------------------------------------------------------
' Procedure : mnuConnect_Click()
' DateTime  : 5/11/2004
' Purpose   : Calls routine to connect FXRS then sets focus to f1.
'---------------------------------------------------------------------------------------
'
Private Sub mnuConnect_Click()
    On Error GoTo EH
    
    Call ConnectFXRS
    
    If f1.Visible And f1 = "" Then
        If f1.Enabled Then f1.SetFocus
    ElseIf cboCustID.Visible And cboCustID = "" Then
        If cboCustID.Enabled Then cboCustID.SetFocus
    ElseIf f50.Enabled Then
        If f50.Enabled Then f50.SetFocus
    ElseIf f12.Visible Then
        If f12.Enabled Then f12.SetFocus
    Else
        If cboContact.Enabled Then cboContact.SetFocus
    End If
    
    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:mnuConnect_Click"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : ConnectFXRS()
' DateTime  : 6/7/2004
' Purpose   : Connects to or disconnects from FXRS depending on the caption of the menu item.
'---------------------------------------------------------------------------------------
'
Public Sub ConnectFXRS()
    On Error GoTo EH
    
    DebugPrint "ConnectFXRS, " & mnuConnect.Caption
    With frmSetup
        DebugPrint "ConnectFXRS, " & "frmSetup 1"
        If mnuConnect.Caption = "&Connect" Then
            If wscFXRS.State <> 7 And .cboFXRSIP <> "" Then
    
                ' debugprint "ConnectFXRS", mnuConnect.Caption, .cboFXRSIP, Val(.txtFXRSPort)
                
                wscFXRS.Connect .cboFXRSIP, Val(.txtFXRSPort)
            End If
            mnuConnect.Enabled = False
        Else
            If wscFXRS.State = 7 Then
                wscFXRS.Close
            End If
            mnuConnect.Caption = "&Connect"
            
            Call AfterDisconnect
            
        End If
    End With
    
    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:ConnectFXRS"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuDepartments_Click()
' DateTime  : 2/10/2005
' Purpose   : Import Departments selected from menu, show import DIMs form
'---------------------------------------------------------------------------------------
'
Private Sub mnuDepartments_Click()
    Call ShowImportForm(False)
    frmImport.Caption = "Import Departments"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuDeptEdit_Click()
' DateTime  : 2/10/2005
' Purpose   : Shows the Dept Add/Edit/Delete form.
'---------------------------------------------------------------------------------------
'
Private Sub mnuDeptEdit_Click()
    frmDeptsEdit.Show vbModeless, Me
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuDIMsEdit_Click()
' DateTime  : 2/10/2005
' Purpose   : Shows the DIMs Add/Edit/Delete form.
'---------------------------------------------------------------------------------------
'
Private Sub mnuDIMsEdit_Click()
    frmDIMsEdit.Show vbModeless, Me
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuDIMs_Click()
' DateTime  : 4/9/2004
' Purpose   : Import Box DIMs selected from menu, show import DIMs form
'---------------------------------------------------------------------------------------
'
Private Sub mnuDIMs_Click()
    Call ShowImportForm(False)
    frmImport.Caption = "Import Box Dimensions"
End Sub
'20070327-14 Removed mnuImportSPPlusZips_Click
'Private Sub mnuImportSPPlusZips_Click()
'    Call ShowImportForm(True)
'    frmImport.Caption = "Import SmartPost+ Zipcodes"
'End Sub

Private Sub mnuLblReprint_Click()
    frmLblReprint.Show vbModeless, Me
End Sub

Private Sub mnuLTLItems_Click()
    Call ShowImportForm(False)
    frmImport.Caption = "Import LTL Item Descriptions"
End Sub

Private Sub mnuLTLItemsEdit_Click()
    frmLTLItemsEdit.Show vbModeless, Me
End Sub

Private Sub mnuMigrate720_Click()
    Call Migrate720Database
End Sub

'---------------------------------------------------------------------------------------
' Procedure : mnuPreAssign_Click()
' DateTime  : 3/2/2005
' Purpose   : preAssign selected from menu, show Pre-Assign form
'---------------------------------------------------------------------------------------
'
Private Sub mnuPreAssign_Click()
    frmPreAssign.Show vbModeless, Me
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuPurge_Click()
' DateTime  : 4/9/2004
' Purpose   : Purge selected from Menu, show Purge form
'---------------------------------------------------------------------------------------
'
Private Sub mnuPurge_Click()
    SSTab1.Tab = 0
    frmPurge.Show vbModeless, Me
End Sub

Private Sub mnuQuote_Click()
    frmQuote.Show vbModeless, Me
   
   '20070914-01 Disable buttons on frmShip
    Call DisableButtons

End Sub

Private Sub mnuShowVerifyForm_Click()
    frmVerifyAddress.Show vbModeless, Me
End Sub
    '---------------------------------------------------------------------------------------
' Procedure : mnuSPFTP_Click()
' DateTime  : 4/9/2004
' Purpose   : Purge selected from Menu, show Purge form
'---------------------------------------------------------------------------------------
'
Private Sub mnuSPFTP_Click()
    
    With frmClose
        .Show vbModeless, Me
        .optClose(3) = True
    End With
    Call SendFTPFile

End Sub

Private Sub mnuSPStdARates_Click()
    Call ShowImportForm(True)
    frmImport.Caption = "Import Std A Rates"
End Sub

Private Sub mnuSPStdBRates_Click()
    Call ShowImportForm(True)
    frmImport.Caption = "Import Std B Rates"
End Sub

Private Sub mnuSPZipToZone_Click()
    Call ShowImportForm(True)
    frmImport.Caption = "Import SmartPost Zip to Zone Table"
End Sub
Private Sub mnuSPPMRates_Click()
    Call ShowImportForm(True)
    frmImport.Caption = "Import Priority Mail Rates"
End Sub

Private Sub mnuTags_Click()
    frmAddTags.Show vbModeless, Me
End Sub

'---------------------------------------------------------------------------------------
' Procedure : opt1358_Click()
' DateTime  : 2/7/2006
' Purpose   : Enables/disables SED/EEI fields based on the option button clicked.
'---------------------------------------------------------------------------------------
'
Private Sub opt1358_Click(Index As Integer)
    
    On Error GoTo EH
    
    If opt1358(0) Then
        cbo1358.Visible = True
        cbo1358.ListIndex = 0
        f1358.Visible = False
        f1358 = ""
        lbl1358.Caption = "Exemption Type:"
    Else
        cbo1358.Visible = False
        cbo1358.ListIndex = -1
        f1358.Visible = True
        lbl1358.Caption = "AES Citation:"
        
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:opt1358_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : optCommodities_Click()
' DateTime  : 3/16/2004
' Purpose   : Setup shipping screens for Intl commodity shipping.
'---------------------------------------------------------------------------------------
'
Private Sub optCommodities_Click()
    Dim i As Integer

    On Error GoTo EH
    
    If optCommodities Then
        chkDuplicate.Value = 0
        lblDecVal.Caption = "Total Carriage Value:"
        lblDecVal.FontBold = False
        fraCommod.Visible = True
        fraDocs.Visible = False
        fraCommodity.Enabled = True
        If frmSetup.f113 Then fraCI.Enabled = True
        '--------------------------------------
        'Added 9/2/05 for new Commodity Summary
        For i = 0 To lblCommodSummary.UBound
            lblCommodSummary(i).Enabled = True
        Next
        cmdViewCommodities.Enabled = True
        '--------------------------------------
        'Added 9/2/05
        f1090.Enabled = True
        f80(0) = Left(frmSetup.f117, 2)
        f80(1) = ""
        
        If frmSetup.chkIntlTab(3) = 0 Then f413.Enabled = True
        chkB13A.Enabled = True
        ' 2008-04-09, JFW, Bug, index from 1
        For i = 1 To lblCommodity.UBound
            If i <> 13 And i <> 4 Then
                lblCommodity(i).Enabled = True
            End If
        Next
        'Added 3/17/05 - changed the label names for CI section
        For i = 0 To lblCI.UBound
            If frmSetup.f113 Then lblCI(i).Enabled = True
        Next
        'Added 6/7 - MPSButtonEnable looks at all factors to determine if it can be enabled
        'cmdMPS.Enabled = MPSButtonEnable
        If f1 <> "" Or cboCustID <> "" Then
            cmdAddToShipment.Enabled = True
        End If
        '03/28/06 Added new SED/EEI fields
        lbl1358.Enabled = True
        opt1358(0).Enabled = True
        opt1358(1).Enabled = True
        f1358.Enabled = True
        cbo1358.Enabled = True
    End If
    
    Call AfterLostFocus(optCommodities)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:optCommodities_Click"
    Exit Sub
    Resume
End Sub
'---------------------------------------------------------------------------------------
' Procedure : optDocument_Click()
' DateTime  : 3/16/2004
' Purpose   : Setup shipping screens for Intl document shipping.
'---------------------------------------------------------------------------------------
'
Private Sub optDocument_Click()
    Dim i As Integer
    
    On Error GoTo EH
    
    If optDocument Then
        lblDecVal.Caption = "Total Customs Value:"
        ' 2011-12-22, JFW, Only some countries require
        ' lblDecVal.FontBold = True
        fraCommod.Visible = False
        fraDocs.Visible = True
        fraCommodity.Enabled = False
        fraCI.Enabled = False
        '--------------------------------------
        'Added 9/2/05 for new Commodity Summary
        For i = 0 To lblCommodSummary.UBound
            lblCommodSummary(i).Enabled = False
        Next
        cmdViewCommodities.Enabled = False
        '--------------------------------------
        'Added 9/2/05
        f1090.Enabled = False
        f80(1) = Left(frmSetup.f117, 2)
        f80(0) = ""
        
        f413.Enabled = False
        chkB13A.Enabled = False
        ' 2008-04-09, JFW, Bug, index from 1.
        For i = 1 To lblCommodity.UBound
            If i <> 13 And i <> 4 Then lblCommodity(i).Enabled = False
        Next
        'Added 3/17/05 - changed the label names for CI section
        For i = 0 To lblCI.UBound
            lblCI(i).Enabled = False
        Next
        'Added 3/28/06 for new SED/EEI fields
        lbl1358.Enabled = False
        opt1358(0).Enabled = False
        opt1358(1).Enabled = False
        f1358.Enabled = False
        cbo1358.Enabled = False
        
        cmdAddToShipment.Enabled = False
                
    End If
    
    Call AfterLostFocus(optDocument)
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:optDocument_Click"
    If False Then
        Resume
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : cboShipmentStatus_Click()
' DateTime  : 3/14/2005
' Purpose   : Update History to show either Shipped or Deleted packages.
'---------------------------------------------------------------------------------------
'
Private Sub cboShipmentStatus_Click()
    If g_blnFormLoadComplete Then
        If (chkIPD.Value = 1 Or chkIntlIPD.Value = 1) And cboShipmentType = "Express IPD" Then
            Call UpdateShipmentsGrid("Express IPD", cboShipmentStatus, "IOR Facility", f1355)
        Else
            Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus)
            txtSearchValue = ""
        End If
    End If
        
End Sub
'---------------------------------------------------------------------------------------
' Procedure : cboShipmentType_Click()
' DateTime  : 3/14/2005
' Purpose   : Update the History to show Express, Ground, Int'l, or IPD pacakges.
'---------------------------------------------------------------------------------------
'
Private Sub cboShipmentType_Click()
    On Error GoTo EH

    Call LoadSearchFields(cboShipmentType)
    If g_blnFormLoadComplete Then
        If cboShipmentType = "Express IPD" And f1355 <> "" Then
            cboSearchField.ListIndex = 2
            txtSearchValue = f1355
            Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus, "IOR Facility", f1355)
        Else
            Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus)
            txtSearchValue = ""
        End If
    End If

    Call SetTrackButtons

    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:cboShipmentType_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : SSTab1_Click()
' DateTime  : 6/2/2004
' Purpose   : Actions to take when tabs are clicked.
'---------------------------------------------------------------------------------------
'
Public Sub SSTab1_Click(PreviousTab As Integer)
    On Error GoTo EH
    
    Dim i As Integer
    Dim aForm As Form
    
    'added 6/30/05 so that if Returns are selected and a trk# is deleted using F6 the
    'Shipments table gets updated rather than the Returns table
    If PreviousTab = 4 And Left(cboShipmentType, 7) = "Returns" Then
        cboShipmentType.ListIndex = 0
    End If
    
    For Each aForm In Forms
        If aForm.name = "frmBOL" Then
            aForm.Hide
        End If
    Next aForm
    
    With frmSetup
    
        'StatusBar1.Panels(2) = ""
        Call SetMenuButton(3, False)    'Disable Track button
        Call SetMenuButton(4, False)    'Disable Ref Track button
        Call SetMenuButton(5, False)    'Disable Rate button
        Call SetMenuButton(6, False)    'Disable Ship button
        Call SetMenuButton(7, False)    'Disable ReLabel button
        Call SetMenuButton(0, True)     'Enable Clear button
        
        Select Case SSTab1.Tab
            Case 0
                If wscFXRS.State = 7 Then
                    Call SetMenuButton(5, True)    'Enable Rate button
                    Call SetMenuButton(6, True)    'Enable Ship button
                End If
                'Only set focus to f1 if form has completed loading and the Setup form is not active
                If g_blnFormLoadComplete Then
                    'Set focus to f1 or cboCustID
                    If f1.Visible And f1 = "" Then
                        '10/6/05 only set focus If locked
                        If f1.Enabled Then f1.SetFocus
                    ElseIf cboCustID.Visible And cboCustID = "" Then
                        '10/6/05 only set focus If locked
                        If cboCustID.Enabled Then cboCustID.SetFocus
                    ElseIf f50.Enabled Then
                        '10/6/05 only set focus If locked
                        If f50.Visible Then f50.SetFocus
                    Else
                        '10/6/05 only set focus If locked
                        If f12.Visible Then f12.SetFocus
                    End If
                End If
            Case 1
                'License Expiration Date calendar
                Calendar2.Today
                'Updated 9/2/05 for Address book shipping
                Call SetCommodSummary
                
                If wscFXRS.State = 7 Then
                    Call SetMenuButton(5, True)    'Enable Rate button
                    Call SetMenuButton(6, True)    'Enable Ship button
                End If
            Case 3
                'Shipped List Ship Date calendar
                Calendar3.Today
                Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus)
                Call SetTrackButtons
            Case 4
                WebBrowser1.Navigate "www.fedex.com/us/"
                Call SetMenuButton(0, False)    'Disable Clear button
        End Select
    End With
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:SSTab1_Click"
    If False Then
        Resume
    End If
    
End Sub
'---------------------------------------------------------------------------------------
' Procedure : StatusBar1_MouseMove()
' DateTime  : 9/6/2007
' Purpose   : Set the Tooltip text to value in panel 2 or 3. This is for errors longer than
'             the panel width.
'---------------------------------------------------------------------------------------
'
Private Sub StatusBar1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If X > 3090 And X < 6430 Then
        StatusBar1.ToolTipText = StatusBar1.Panels(2)
    ElseIf X >= 6430 And X < 9705 Then
        StatusBar1.ToolTipText = StatusBar1.Panels(3)
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : Timer1_Timer()
' DateTime  : 4/9/2004
' Modified  : 8/20/2004
' Change    : Added FormLoadComplete boolean to here
' Purpose   : Updates status bar with Winsock state info
'
' 2008-08-09, JFW, Bug on no net connect, DisableButtons was called continuously.
'---------------------------------------------------------------------------------------
'
Private Sub Timer1_Timer()

    On Error GoTo EH
    
    Static dtFirstConnect As Date
    Static boolFirstConnect As Boolean
    Static strState As String
    Dim i As Long
    
    Select Case wscFXRS.State
        Case 0
            StatusBar1.Panels(1).Text = "Disconnected from FSMS"
            If strState <> CStr(wscFXRS.State) Then
                Call DisableButtons
            End If
        
            ' 2010-07-20, JFW, Moved here from form load.
            If Not boolFirstConnect Then
                boolFirstConnect = True
                If frmSetup.chkConnectOnStartup = 1 Then
                    ' debugprint "frmShip", "Timer1", "calling ConnectFXRS"
                    DebugPrint "frmShip, Timer1, calling ConnectFXRS"
                    dtFirstConnect = Now
                    Call ConnectFXRS
                End If
            End If
        
            ' To do auto restart, until manually Disconnected.
            If Now > DateAdd("s", 60, dtFirstConnect) Then
            
            End If
            
        Case 1
            StatusBar1.Panels(1).Text = "Socket Open"
        Case 3
            StatusBar1.Panels(1).Text = "Connection Pending"
        Case 4
            StatusBar1.Panels(1).Text = "Resolving Host"
        Case 5
            StatusBar1.Panels(1).Text = "Host Resolved"
        Case 6
            StatusBar1.Panels(1).Text = "Connecting"
            For i = 0 To (Second(Now) Mod 4)
                StatusBar1.Panels(1).Text = StatusBar1.Panels(1).Text & " ."
            Next i
        Case 7
            '20070906-01 Show host name/ip addr that we're connected to.
            StatusBar1.Panels(1).Text = "Connected to FSMS: " & frmSetup.cboFXRSIP
        Case 8
            wscFXRS.Close
            mnuConnect.Caption = "&Connect"
            mnuConnect.Enabled = True
    End Select
    
    Call PDFlabelShow
    
    strState = CStr(wscFXRS.State)
    g_blnFormLoadComplete = True
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:Timer1_Timer"

End Sub

Private Sub timerControl_Timer()

    On Error GoTo EH
    Dim strPassword As String
    Dim strCountry As String
    Dim Index As Long
    
    timerControl.Enabled = False
    
    On Error Resume Next
    Index = m_objControl.Index
    On Error GoTo EH
    
    Select Case m_objControl.name
    Case "cboLocationName"
        ' DebugPrint "cboLocationName_Click, 0, text " & cboLocationName(0).Text
        
        Select Case Index
            Case 0 'Ship tab
                If g_clsSettings.Setting("LocationPasswordEnabled") = "True" Then
                    If g_clsSettings.Setting("Password_" & Replace(cboLocationName(0).Text, " ", "_")) <> "" Then
                        strPassword = InputBox("Enter password for location")
                    End If
                End If
                If g_clsSettings.Setting("Password_" & Replace(cboLocationName(0).Text, " ", "_")) = strPassword Then
                                    
                    ' DebugPrint "cboLocationName_Click, 1, text " & cboLocationName(0).Text
                                    
                    frmSetup.cboName.Text = cboLocationName(0).Text
                    strCountry = Left(f50.Text, 2)
                    Call frmSetup.cboName_Click
                    If strCountry <> "" And strCountry <> Left(f50.Text, 2) Then
                        f50.Text = strCountry
                    End If
    
                    ' DebugPrint "cboLocationName_Click, 2, text " & cboLocationName(0).Text
    
                    ' 2010-09-07, JFW, was cboLocationName(1) <> ""
                    If cboLocationName(0) <> "" And cboLocationName(1) <> cboLocationName(0) Then
                        cboLocationName(1) = cboLocationName(0)
                    End If
                    Call frmSetup.SaveRegValues
                    Call frmSetup.AssignSetupToGlobalVars
                    Call ShowSpecialSvcs
                    Call LoadServices(Left(f1274, 2))
                    Call LoadPackaging(Left(f1273, 2))
                    '03/06/2006 New Hook sub added
                    Call AfterLocationChange
                    Call AfterLostFocus(cboLocationName(0))
                Else
                    cboLocationName(0) = ""
                End If
                
                ' DebugPrint "cboLocationName_Click, 3, text " & cboLocationName(0).Text
                
                If cboLocationName(0) = "" Then
                    Call SetMenuButton(6, False)    'Disable Ship button
                ElseIf wscFXRS.State = 7 Then
                    Call SetMenuButton(6, True)    'Disable Ship button
                Else
                    Call SetMenuButton(6, False)    'Disable Ship button
                End If
            Case 1 'History tab
                If g_blnFormLoadComplete Then Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus)
        End Select
        
        ' DebugPrint "cboLocationName_Click, 4, text " & cboLocationName(0).Text
        
    End Select
    
    Exit Sub
EH:
    MsgBox "Ship.Control, " & m_objControl.name & ", " & Err.Description, vbCritical, "Ship.Control"


End Sub

Private Sub timerDate_Timer()

    If Not IsDate(f24.Text) Then
        f24.Text = Date
    ElseIf CDate(f24.Text) < Date Then
        f24.Text = Date
    End If
    
End Sub

Private Sub timerIdle_Timer()

    Static lngIdleTimeout As Long
    
    If lngIdleTimeout = 0 Then
        If g_clsSettings.Setting("IdleTimeout") <> "" Then
            If Not IsNumeric(g_clsSettings.Setting("IdleTimeout")) Then
                g_clsSettings.Setting("IdleTimeout") = ""
            End If
        End If
        If g_clsSettings.Setting("IdleTimeout") = "" Then
            g_clsSettings.Setting("IdleTimeout") = 60
            g_clsSettings.SaveSettings
        End If
        lngIdleTimeout = CLng(g_clsSettings.Setting("IdleTimeout"))
    End If
    
    If IsDate(timerIdle.Tag) Then
        If cboLocationName(0) = "" Then
            lblLocationName.FontBold = Not lblLocationName.FontBold
        ElseIf DateDiff("s", CDate(timerIdle.Tag), Now) > lngIdleTimeout Then
            If g_clsSettings.Setting("LocationPasswordEnabled") = "True" Then
                If g_clsSettings.Setting("Password_" & Replace(cboLocationName(0).Text, " ", "_")) <> "" Then
                    cboLocationName(0) = ""
                    cboLocationName(0).SetFocus
                    Call SetMenuButton(6, False)    'Disable Ship button
                End If
            End If
        ElseIf DateDiff("s", CDate(timerIdle.Tag), Now) > (lngIdleTimeout - 5) Then
                frmMsgBox.ShowMessage "Session is inactive.  Logging out.", 4000
        End If
    Else
        timerIdle.Tag = Now
    End If

End Sub
'

Private Sub timerRate_Timer()

    If Now > DateAdd("s", 1, dtRateTime) Then
        timerRate.Enabled = False
        Call RateButton
    End If
    
End Sub

Private Sub timerTDAutoClose_Timer()

    If TDAutoCloseEnabled Then
        If g_blnFormLoadComplete Then
            If Hour(Now) >= 17 And Hour(Now) < 18 Then
            ' If Hour(Now) = 12 And Minute(Now) >= 33 And Minute(Now) < 36 Then
                If g_frmTDAutoClose Is Nothing Then
                    Set g_frmTDAutoClose = New frmTD
                    Call g_frmTDAutoClose.AutoClose
                End If
            End If
            If Hour(Now) >= 18 Then
            ' If Hour(Now) = 12 And Minute(Now) >= 36 Then
                If Not g_frmTDAutoClose Is Nothing Then
                    Unload g_frmTDAutoClose
                    Set g_frmTDAutoClose = Nothing
                End If
            End If
        End If
    Else
        timerTDAutoClose.Enabled = False
    End If
    
End Sub

'---------------------------------------------------------------------------------------
' Procedure : txtCommodityWgt_Change()
' DateTime  : 3/16/2004
' Purpose   : Wgt Each field is numeric only
'---------------------------------------------------------------------------------------
'
Private Sub txtCommodityWgt_Change()
    Call NumericOnly(txtCommodityWgt)
End Sub
'---------------------------------------------------------------------------------------
' Procedure : txtCommodityWgt_LostFocus()
' DateTime  : 3/16/2004
' Purpose   : Calculate Total commodity wgt
'---------------------------------------------------------------------------------------
'
Private Sub txtCommodityWgt_LostFocus()
    Call CalcTotalWgt
End Sub
'---------------------------------------------------------------------------------------
' Procedure : txtDelDate_Change()
' DateTime  : 4/6/2006
' Purpose   : Used for mode optimization
'---------------------------------------------------------------------------------------
'
Private Sub txtDelDate_Change()
    Call SetDelDateBkGrnd
End Sub
'---------------------------------------------------------------------------------------
' Procedure : SetDelDateBkGrnd()
' DateTime  : 4/6/2006
' Purpose   : Set the background color based on the Ship Date field.
'---------------------------------------------------------------------------------------
'
Private Sub SetDelDateBkGrnd()
    If IsDate(txtDelDate) Then
        If DateDiff("d", CDate(f24), CDate(txtDelDate)) > 0 Then
            txtDelDate.BackColor = &HC0E0FF
        ElseIf DateDiff("d", CDate(f24), CDate(txtDelDate)) <= 0 Then
            txtDelDate.BackColor = 255
        End If
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : txtSearchValue_Change()
' DateTime  : 10/6/2004
' Purpose   : Extracts the Express or Ground Trk# if barcode is scanned.
'---------------------------------------------------------------------------------------
'
Private Sub txtSearchValue_Change()
    
    If cboSearchField = "Trk #" Then
            'Extracts trk# from a ASTRA barcode scanned into the f29 field
        If Len(txtSearchValue) = 32 And (Left(txtSearchValue, 1) = "3" Or Left(txtSearchValue, 1) = "4") Then
            txtSearchValue = Mid(txtSearchValue, 17, 12)
        End If
        'Extracts trk# from a FedEx Ground barcode scanned into the f29 field
        If Len(txtSearchValue) = 22 And Left(txtSearchValue, 2) = "96" Then
            txtSearchValue = Right(txtSearchValue, 15)
        End If
    End If

End Sub
'---------------------------------------------------------------------------------------
' Procedure : txtShipDate_LostFocus()
' DateTime  : 3/18/2004
' Purpose   : Used on this Shipped List tab to show shipments for a given date.
'---------------------------------------------------------------------------------------
'
Private Sub txtShipDate_LostFocus()
    If IsDate(txtShipDate) Then
        If DateDiff("d", Date, CDate(txtShipDate)) <> 0 Then
            txtShipDate.BackColor = &HC0E0FF
        Else
            txtShipDate.BackColor = &HFFFFFF
        End If
    End If
    
    Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus)
End Sub

'---------------------------------------------------------------------------------------
' Procedure : WebBrowser1_NavigateComplete2()
' DateTime  : 3/18/2004
' Updated   : 8/17/2005 - Modified InStr search text to look for new Fedex URL text.
'           : 9/14/2005 - Modified InStr search text to look for new SmartPost URL text.
' Purpose   : Used on this Shipped List tab to show shipments for a given date.
'---------------------------------------------------------------------------------------
'
Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    If InStr(1, URL, "http://www.fedex.com/Tracking?") > 0 Or _
       InStr(1, URL, "https://www.fedex.com/AltRefTracking?") > 0 Or _
       InStr(1, URL, "http://spportal.fedex.com") > 0 Then
        
            StatusBar1.Panels(2) = "Tracking Complete"
    
    End If
End Sub

'---------------------------------------------------------------------------------------
' Procedure : wscFXRS_Connect
' DateTime  : 12/08/2003
' Purpose   : Winsock connect event. Change mnuConnect caption to Disconnect and enable
'             all buttons that require FXRS connectivity.
'---------------------------------------------------------------------------------------
'
Private Sub wscFXRS_Connect()
        mnuConnect.Caption = "&Disconnect"
        StatusBar1.Panels(1).Text = "Connected to " & frmSetup.cboFXRSIP
        StatusBar1.Panels(2) = ""
        Call EnableButtons
        Call AfterConnect
End Sub
'---------------------------------------------------------------------------------------
' Procedure : wscFXRS_Error
' DateTime  : 12/08/2003
' Modified  : 9/8/2004 - Changed message to support multiple hosts. If only one host
'             show error and Retry/Cancel, if 2 hosts show OK/Cancel to try the  backup,
'             else show OK/Cancel to show Setup to select which host to try.
' Purpose   : Winsock error event. Show error MsgBox, close connection and enable
'             Connect button.
'---------------------------------------------------------------------------------------
'
Private Sub wscFXRS_Error(ByVal number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
    
    On Error GoTo EH
    
    Dim strMessage As String
    Dim ret As Integer
    Dim i As Integer
   
    wscFXRS.Close
    mnuConnect.Caption = "&Connect"
    mnuConnect.Enabled = True
    StatusBar1.Panels(2) = "FSMS Connection Error"
    
    Call AfterDisconnect
    
    With frmSetup
        If .cboFXRSIP.ListCount = 1 Then
            strMessage = "The following error occurred while attempting" & vbCrLf
            strMessage = strMessage & " to communicate with the FSMS Server:" & vbCrLf & vbCrLf
            strMessage = strMessage & Chr(34) & Description & Chr(34) & vbCrLf & vbCrLf
            strMessage = strMessage & "Click Retry to try this connection again or "
            strMessage = strMessage & "click Cancel to exit."
            strMessage = strMessage & vbCrLf & vbCrLf & "Please notify your system administrator of this problem!"
            
            ret = MsgBox(strMessage, vbRetryCancel, "Communication Error")
    
            If ret = 4 Then
                Call mnuConnect_Click
            End If
        ElseIf .cboFXRSIP.ListCount = 2 Then
            strMessage = "The following error occurred while attempting to communicate " & vbCrLf
            strMessage = strMessage & "with the FSMS Server at address " & .cboFXRSIP & ":" & vbCrLf & vbCrLf
            strMessage = strMessage & Chr(34) & Description & Chr(34) & vbCrLf & vbCrLf
            strMessage = strMessage & "Click OK to try the backup server or click Cancel to exit."
            strMessage = strMessage & vbCrLf & vbCrLf & "Please notify your system administrator of this problem!"
            
            ret = MsgBox(strMessage, vbOKCancel, "Communication Error")
            If ret = 1 Then
                .cboFXRSIP.ListIndex = IIf(.cboFXRSIP.ListIndex = 0, 1, 0)
                Call mnuConnect_Click
            End If
        Else
            strMessage = "The following error occurred while attempting to communicate " & vbCrLf
            strMessage = strMessage & "with the FSMS Server at address " & .cboFXRSIP & ":" & vbCrLf & vbCrLf
            strMessage = strMessage & Chr(34) & Description & Chr(34) & vbCrLf & vbCrLf
            strMessage = strMessage & "Click OK to select a backup server or click Cancel to exit."
            strMessage = strMessage & vbCrLf & vbCrLf & "Please notify your system administrator of this problem!"
            
            ret = MsgBox(strMessage, vbOKCancel, "Communication Error")
            If ret = 1 Then
                With frmSetup
                    For i = 1 To .SSTab1.Tabs - 1
                        .SSTab1.TabEnabled(i) = False
                    Next
                    .Show vbModeless, Me
                    .cboFXRSIP.SetFocus
                End With
            End If
        End If
    End With
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:wscFXRS_Error"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : wscFXRS_DataArrival
' DateTime  : 12/08/2003
' Purpose   : Winsock DataArrival event. Once 99,"" is received call g_clsParser.ParseData
'             method.
'---------------------------------------------------------------------------------------
'
Private Sub wscFXRS_DataArrival(ByVal bytesTotal As Long)
    Dim strReply As String    'var to store the reply
    
    On Error GoTo EH
    
    'Get the data from Winsock
    wscFXRS.GetData strReply, bytesTotal
    'Store current data packet in case reply takes multiple packets
    
    DebugPrint "DataArrival, " & strReply
    ' debugprint "DataArrival, " & strReply
    
    g_strReply = g_strReply & strReply
    
    'Check for 99,"" to see if you got the whole transaction else exit
    If InStr(1, strReply, "99," & Chr(34) & Chr(34)) = 0 Then
        Exit Sub
    Else
        g_strSaveReply = g_strReply
        
        '10/4/05 added for Debug
        If g_blnDebug Then frmDebug.ProcessTransOut (g_strReply)
        
        g_clsParser.ParseData g_strReply
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:wscFXRS_DataArrival"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : GetIndex
' DateTime  : 20070328-02 Added to support new Service Quote
' Purpose   : Returns the an int of the Index of the array of services in Service Quoting
'---------------------------------------------------------------------------------------
'
Private Function GetIndex(ByVal strType As String) As Integer
    Select Case Right(strType, 2)
        Case "06"
            GetIndex = 0
        Case "01"
            GetIndex = 1
        Case "05"
            GetIndex = 2
        Case "03"
            GetIndex = 3
        Case "20"
            GetIndex = 4
        Case "92"
            GetIndex = 5
        Case "90"
            GetIndex = 6
    End Select
        
End Function
'---------------------------------------------------------------------------------------
' Procedure : g_clsParser_ParseComplete
' DateTime  : 11/28/2003
' Modified  : 11/11/2004 - Added Version Capture Reply Case "170"
' Purpose   : clsFXRSParser class Event fires when a transaction has been completely parsed.
'           : Select Case statement inside of the For loop allows us to grab the fields
'           : needed from the FXRS reply.
'---------------------------------------------------------------------------------------
'
Private Sub g_clsParser_ParseComplete()
        
    On Error GoTo EH
    
    Dim i As Integer
    Dim j As Integer
    Dim strReplyType As String
    Dim strTemp29 As String             'Temp var to hold trk# not returned on delete error
    Dim str29() As String               'Used to store MPS trk# for SaveShipment
    Dim str3063() As String             'Used to store MPS Ground barcode strings for custom labels
    Dim bCustomGroundMPS As Boolean     'True indicates MPS Ground custom labels
    
    ReDim str29(Val(g_str116))
    ReDim str3063(Val(g_str116))
    
    '09/18/06 Moved here from wscFXRS.DataArrival
     g_strReply = ""

    If (g_str1274 = "92" Or g_str1274 = "90") And frmSetup.chkCustomLabels = 1 Then
        bCustomGroundMPS = True
    Else
        bCustomGroundMPS = False
    End If
    
    strTemp29 = g_str29
    'Clear the variables
    g_str3 = ""
    g_str28 = ""
    g_str29 = ""
    g_str37 = ""
    g_str539 = ""
    g_str560 = ""
    g_str1123 = ""
    g_str1125 = ""
    g_str1011 = ""
    g_str1012 = ""
    g_str1393 = ""
    
    With g_clsParser
        For i = 0 To .TotalFields - 1
            Select Case .Field(i)
                Case "0"                    'Trans Type
                    strReplyType = .Data(i)
                Case "1"                    'TransID
                    g_str1 = .Data(i)
                Case "3"                    'Error message
                    ' 2011-04-19, JFW, ignore rating error
                    If Left(.Data(i), 47) = "com.fedex.sasv.SasvException: An invalid origin" Then
                    Else
                        g_str3 = .Data(i)
                    End If
                Case "28"                   'COD Return Trk#
                    g_str28 = .Data(i)
                Case "29"                   'Trk#
                    g_str29 = .Data(i)
                Case "33"                   'Service Area
                    g_str33 = .Data(i)
                Case "34"                   'Gross Charge
                    g_str34(GetIndex(g_str1)) = .Data(i)
                Case "35"                   'Total Surcharge
                    g_str35(GetIndex(g_str1)) = .Data(i)
                Case "36"                   'Total Discount
                    g_str36(GetIndex(g_str1)) = .Data(i)
                Case "37"                   'Net charges for rate trans
                    g_str37 = .Data(i)
                    
                    If g_str29 <> "" Then
                        StatusBar1.Panels(3) = "Rate: $" & Format(Val(g_str37) * 0.01, "#####.00")
                    End If
                    
                Case "60"                   'Billed Weight
                    g_str60 = .Data(i)
                Case "188"                  'Label
                    g_str188 = .Data(i)
                Case "409"                  'Deliver By Date
                    g_str409 = .Data(i)
                Case "421"                  'List Total Discount
                    g_str421 = .Data(i)
                Case "539"                  'Taxes
                    g_str539 = .Data(i)
                Case "560"                  'Return on Ground rating errors
                    g_str560 = .Data(i)
                Case "1123"                 'Master trk# for IPD and MPS
                    g_str1123 = .Data(i)
                Case "1125"                 'Returned on Rating errors
                    g_str1125 = .Data(i)
                Case "1011"
                    g_str1011 = .Data(i)    'Added 01/26/06 for Call/Express Tags
                Case "1012"
                    g_str1012 = .Data(i)    'Added 01/26/06 for Call/Express Tags
                Case "1393"
                    g_str1393 = .Data(i)
                '20070328-02 Fields added for Service Quote.
                Case "1507"
                    g_str1507(GetIndex(g_str1)) = .Data(i)    'List Total Surcharges
                Case "1519"
                    g_str1519(GetIndex(g_str1)) = .Data(i)    'List Gross rate
                Case "1523"
                    g_str1523 = .Data(i)    'List DV Surcharges
                Case "1528"
                    g_str1528 = .Data(i)    'List Net Rate
                Case "1596"
                    g_str1596 = .Data(i)    'Handling Charge
                Case "1597"
                    g_str1597 = .Data(i)    'List Handling Charge
                Case "1598"
                    g_str1598 = .Data(i)    'Total customer charge
                Case "1599"
                    g_str1599 = .Data(i)    'List Total customer charge
                Case "1981"
                    g_str1981 = .Data(i)    'Commit Time
                Case "2418"
                    g_str2418 = .Data(i)    'SmartPost DCB
                Case "3058"
                    g_str3058 = .Data(i)    'Time in Transit
                
            End Select
            If Val(g_str116) > 1 Then
                For j = 2 To Val(g_str116)
                    If .Field(i) = "29-" & Trim(Str(j)) Then str29(j) = .Data(i)
                    If .Field(i) = "3063-" & Trim(Str(j)) Then str3063(j) = .Data(i)
                Next
            End If
        Next
    End With
    
    'Added 8/4/05 to capture Express COD Master trk# since it doesn't return 1123
    If g_str28 <> "" And g_str1274 <> "92" Then
        g_str1123 = g_str29
    End If
    
    Select Case strReplyType
        Case "120"
        
            ' Debug.Assert (g_blnIPD And Left(g_str1, 4) = "IPD ") Or (Not g_blnIPD And Left(g_str1, 4) <> "IPD ") Or g_str1 = "RATE ONLY"
        
            'Indicates a Rate from the Ship tab
            If g_str1 = "RATE ONLY" Then
                If g_str3 = "" And (g_str1125 = "0" Or g_str1125 = "") Then
                
                    ' 2014-09-01, JFW, Check IPD rate
                    If Left(f1274.Text, 2) = "18" Then
                        Call IPDRate
                    End If
                    
                    ' 2010-04-30, JFW, Rate in spot 3
                    StatusBar1.Panels(3) = "Rate: $" & Format(Val(g_str37) * 0.01, "#####.00")
                    '20071106-01 New hook
                    Call AfterRateQuote
                Else
                    ' 2010-04-30, JFW, Rate in spot 3
                    StatusBar1.Panels(3) = "Rate Error: " & GetRateError(g_str1125)
                End If
            '20070328-02 for Service Quote
            ElseIf Left(g_str1, 5) = "QUOTE" Then
                If g_str3 = "" Then
                    Call frmQuote.QuoteReply(Right(g_str1, 2), False)
                    '20071106-01 New hook
                    Call AfterRateQuote
                Else
                    Call frmQuote.QuoteReply(Right(g_str1, 2), True)
                End If
            'Indicates a Batch Error Check
            ElseIf g_blnBatchErrorCheck Then
                        g_lngShipCount = g_lngShipCount + 1
                Call WriteBatchError
            
            'Indicates a return label reply
            ElseIf g_str1 = "RETURN" Then
                Call ReturnReply(g_str29)
            '01/11/06 Added LTL
            ElseIf g_str1274 = "111" Then
                Call LTLReply
            
            'Indicates an IPD Shipment
            ElseIf g_blnIPD Then
                
                Call IPDReply
            
            ' 2007-05-15, JFW, No longer for TD children
            'Indicates an TD Shipment
            ElseIf g_blnTDInProgress Then
                
                Call TDReply
                
                ' US domestic return
                Debug.Assert False
                
            'Else it's a Ship trans
            Else
                If g_str3 <> "" Then
                    If g_blnBatch Then
                        Call WriteBatchError
                        '10/23/05 Added for creating DO NOT SHIP labels on errors
                        If frmSetup.chkCustomLabels = 1 Then
                            Call CreateCustomLabel
                        End If
                    Else
                        Call WriteError
                        frmShip.StatusBar1.Panels(2) = "Shipment Error"
                        'Clear MPS flag so buttons will be enabled
                        g_blnMPS = False
                    End If
                Else
                    '20070702-01 Added to allow Batch rating with custom labels
                    If frmSetup.chkCustomLabels = 1 And g_str29 <> "" Then
                        Call CreateCustomLabel
                        'Modified 9/30 for Ground MPS Custom labels - add check for "B"
                        If bCustomGroundMPS And g_str1282 = "B" Then
                            For j = 2 To Val(g_str116)
                                Call CreateCustomLabel(j, str3063(j))
                            Next
                        End If
                    End If
                    
                    'Added 8/31/04 to save Address if visible and checkbox checked
                    If cboCustID.Visible = True And chkAddAddress = 1 Then
                        Call SaveAddress(cboCustID)
                        Call LoadAddrLookupCombos(cboCustID, cboCustID, "CustID")
                        Call LoadAddrLookupCombos(cboContact, cboContact, "f12")
                        Call LoadAddrLookupCombos(cboCompany, cboCompany, "f11")
                    End If
                    
                    '20070327-12 Removed SPPlus check
                        
                    'Save single piece trk# or Master trk# from MPS
                    Call SaveShipment(g_str29, 1)
                    
                    'Save MPS trks#
                    If chkDuplicate.Value = 0 And Val(g_str116) > 1 And Not g_blnMPS Then
                        For i = 2 To Val(g_str116)
                            Call SaveShipment(str29(i), i)
                        Next
                    End If
                    
                    Call ShipIntlCommodities(g_str1, g_str29)
                                        
                    Call LocalDocumentsUS
                    
                    'Call routines to WriteReply
                    If g_blnBatch Then
                        Call WriteBatchReply
                        Call AfterBatchShip
                    ElseIf g_blnBatchEdit Then
                        Call WriteBatchReply
                        g_blnBatchEdit = False
                        StatusBar1.Panels(2) = "Shipment Complete"
                        '01/17/06 Added for pkgs not written back using AfterBatch hook
                        Call WriteBatchEditReply
                    ElseIf g_blnMPS Then
                        Call WriteReply
                    Else
                        Call WriteReply
                        StatusBar1.Panels(2) = "Shipment Complete"
                    End If
                    
                    ' If intl return then need to copy commodities
                    ' Debug.Assert False
                    
                    With frmMPS
                        If .chkPrintAsAdd = 1 Then
                            '10/6/06 Added to support returns w/MPS Print as Pkgs are Added
                            If g_str2382 = "2" Then
                                Call SendMPSReturnsTrans(g_str1)
                            End If
                            Call DeleteMPS(f1)
                            Call .UpdateMPSGrid(f1)
                        End If
                    End With
                    'If there's not an error then continue with duplicates
                    'or clear screen
                    If chkDuplicate.Value = 1 Then
                        If Val(g_str116) > g_intDupCount Then
                            g_intDupCount = g_intDupCount + 1
                            Call ShipButton
                        ElseIf g_str2382 = "2" Then
                            Call SendDuplicateReturns(g_str116)
                        Else
                            g_intDupCount = 1
                            Call DeleteMPS(g_str1)
                            Call frmPreAssign.DeletePreAssignFromMDB(g_str1)
                            Call ClearShipFields
                            Call ClearGlobalVars
                            Call SetLogo
                        End If
                    'Don't clear screen if shipping MPS in single transactions or printing as adding
                    'from MPS form.
                    ElseIf Not g_blnMPS And frmMPS.chkPrintAsAdd = 0 Then 'And frmReturnLbl.chkNoShipLabel = 0 Then
                        
                        If g_str2382 = "2" Then
                        
                            Debug.Assert False
                        
                            If g_str116 > 1 Then
                                Call SendMPSReturnsTrans(g_str1)
                            Else
                                If frmReturnLbl.chkOnlineRetLbl = 1 Then
                                    Call SendData(BuildOnlineReturnLabel)
                                Else
                                    Call SendData(BuildReturnLabel)
                                End If
                            End If
                        End If
                        Call DeleteMPS(g_str1)
                        Call frmPreAssign.DeletePreAssignFromMDB(g_str1)
                        'Only Clear if not doing return labels and not doing batch returns
                        '06/12/06 Added "And f2382(3) = 0" for Intra-CA Returns
                        If f2382(0) = 0 And f2382(1) = 0 And f2382(2) = 0 And f2382(3) = 0 And f2382(4) = 0 And f2382(5) = 0 And Not g_blnBatchReturn Then
                            Call ClearShipFields
                            Call ClearGlobalVars
                        End If
                        Call SetLogo
                    End If
                End If
            End If
            
       'Delete reply - if error, show FXRS error and trk#
        Case "123"
            
            Call DeleteReply(strTemp29)
        
        '20070907-01 Added for Rate All trans used in Batch only
        Case "125"
        
            Call RateAllReply
               
        'Close reply - if error show FXRS error
        Case "107"
            
            Call CloseReply
        
        Case "104"
            
            Call TrkNumReply
        
        Case "195"
            
            Call LblReprintReply(g_str29)
            
        Case "137"
            Call OnlineReturnReply(g_str29)
        
        Case "515"
            Call frmVerifyAddress.AddrVerifyReply
        
        Case "144", "146", "148"
            Call TagReply
            
        Case "145", "147"
            Call TagCancelReply
        
    End Select
    
    'Boolean used to control batch, COD 1st piece, TrkNum requests, & multiple deletes.
    'Do next transaction.
    g_blnComplete = True
    g_blnTDChild = False
    
    'Enable all transaction buttons if not batch or MPS processing
    If Not g_blnBatch And Not g_blnMPS And Left(g_str1, 5) <> "QUOTE" Then
        Call EnableButtons
    End If
    
    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:g_clsParser_ParseComplete"

End Sub
'---------------------------------------------------------------------------------------
' Module    : DeleteReply()
' DateTime  : 2/10/2005
' Author    : Chris Elwell
' Purpose   : Handle Delete Replies. Moved out of ParseComplete.
'---------------------------------------------------------------------------------------
'
Private Sub DeleteReply(ByVal str29 As String)
    
    On Error GoTo EH
    
    If g_str3 <> "" _
    And 0 = InStr(1, g_str3, "number not found") _
    And 0 = InStr(1, g_str3, "already deleted") Then
        MsgBox g_str3 & " : " & str29, vbExclamation, "Delete Error"
        frmDelete.f29.BackColor = &HC0E0FF
        frmDelete.f29.SelStart = 0
        frmDelete.f29.SelLength = Len(frmDelete.f29)
        frmShip.StatusBar1.Panels(2) = "Delete Error"
    Else
        If Left(cboShipmentType, 7) = "Returns" Or g_blnReturnDelete = True Then
            Call ChangeReturnStatusToDelete(str29)
            Call WriteReturnDelete(str29)
        Else
            Call ChangeStatusToDelete(str29)
            Call WriteDelete(str29)
            'Added 7/18/05 to check for return labels that the user may want to delete
            Call CheckForReturns(str29)
        End If
        frmDelete.f29 = ""
        frmDelete.f29.BackColor = &HC0E0FF
        StatusBar1.Panels(2) = str29 & " Deleted!"
        If g_blnDeletesComplete Then
            Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus)
            Call SetTrackButtons
        End If
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:DeleteReply"

End Sub
'---------------------------------------------------------------------------------------
' Module    : CloseReply()
' DateTime  : 2/10/2005
' Author    : Chris Elwell
' Purpose   : Handle Close Replies. Moved out of ParseComplete.
'---------------------------------------------------------------------------------------
'
Private Sub CloseReply()
            
    If g_str3 <> "" Then
        frmClose.lstCloseStatus.AddItem "Close Error: " & g_str3
    Else
        frmClose.lstCloseStatus.AddItem "Close Complete!"
    End If
    g_blnNextClose = True
    
    Call AfterClose

End Sub
'---------------------------------------------------------------------------------------
' Module    : RateAllReply()
' DateTime  : 20070907-02
' Author    : Chris Elwell
' Purpose   : Handle RateAll replies that are in Batch only.
'---------------------------------------------------------------------------------------
'
Private Sub RateAllReply()
    
    If g_str3 <> "" Then
        Call WriteBatchError
    Else
        Call WriteBatchReply
    End If
    Call ClearShipFields
    Call ClearGlobalVars

End Sub
'

Private Sub IPDRate()

    Dim dblWeight As Double
    Dim dblFuelRate As Double
    Dim dblRate34 As Double
    Dim dblRate35a As Double
    Dim dblRate37 As Double
    Dim dblRate1393 As Double
    Dim i As Integer
    
    If IsNumeric(g_str60) Then
        dblWeight = CDbl(g_str60)
        If Left(f75.Text, 3) = "KGS" Then dblWeight = dblWeight / 10
    ElseIf IsNumeric(g_str1670) Then
        dblWeight = CDbl(g_str1670) / 100
    Else
        dblWeight = 1
    End If
    If Left(f75.Text, 3) = "LBS" Then dblWeight = dblWeight * 0.454
    If Not IsNumeric(g_str34(0)) Then g_str34(0) = 0
    If Not IsNumeric(g_str35(0)) Then g_str35(0) = 0
    If Not IsNumeric(g_str36(0)) Then g_str36(0) = 0
    If Not IsNumeric(g_str37) Then g_str37 = 0
    If Not IsNumeric(g_str1393) Then g_str1393 = 0
    
    dblRate34 = dblWeight * 1.01 + 7.1
    If CDbl(g_str34(0)) > 0 Then
        dblFuelRate = Round(CDbl(g_str1393) / (CDbl(g_str34(0)) + CDbl(g_str35(0)) - CDbl(g_str1393)), 4)
    End If
    g_dblFuelRate = dblFuelRate
    dblRate35a = (CDbl(g_str35(0)) - CDbl(g_str1393)) / 100
    dblRate1393 = Round((dblRate34 + dblRate35a) * dblFuelRate, 2)
    
    g_str34(0) = Round(dblRate34 * 100)
    g_str35(0) = Round(dblRate35a * 100) + Round(dblRate1393 * 100)
    g_str1393 = Round(dblRate1393 * 100)
    g_str37 = CLng(g_str34(0)) + CLng(g_str35(0)) - CLng(g_str36(0))
        
'    3)  Fuel Surcharge with 25% waived for CDI.
'a)  Fuel surcharge% is updated once a month and can be determined by using of the web services or server function provided by FedEx; and
'b)  Apply a 25% off the fuel surcharge amount. E.g.
'i)  Shipping charge for an order determined by weight and address is $100 so the Fuel surcharge % for current month is 80% of shipping charge.
'ii) Fuel surcharge for this order will be $100 * 9.5% * (100%-25%) = $ 7.125.
'iii)    The total shipping cost for the order will be $100 + $7.125 = $107.13.


    
End Sub

'---------------------------------------------------------------------------------------
' Module    : IPDReply()
' DateTime  : 2/10/2005
' Author    : Chris Elwell
' Purpose   : Handle IPD Replies. Moved out of ParseComplete.
'---------------------------------------------------------------------------------------
'
Private Sub IPDReply()
    
    On Error GoTo EH
    
    Dim i As Long
    
    If g_str3 = "" Then
        Select Case Left(g_str1, 15)
            'Create shipment
            Case "IPD MAWB CREATE"
                Call SaveIPDShipment(g_str29, True)
                g_frmIPDAdd.Hide
                With g_frmIPD
                    .f24 = g_frmIPDAdd.f24
                    f24 = .f24
                    .cboIPDStatus = "Open"
                    Call .UpdateIPDGrid("Open", .f24)
                    frmShip.StatusBar1.Panels(2) = "MAWB Created"
                End With
                Call g_frmIPDAdd.SaveIOR
                Call LoadIORCombo(frmSetup.f10, f24)
                With g_frmIPDAdd
                    .f1297 = ""
                    .f1358 = ""
                End With
            'Delete shipment
            Case "IPD MAWB DELETE"
                Call ChangeIPDStatus(Right(g_str1, 12), "Deleted")
                With g_frmIPD
                    .f24 = g_frmIPDAdd.f24
                    .cboIPDStatus = "Open"
                    Call .UpdateIPDGrid("Open", .f24)
                    frmShip.StatusBar1.Panels(2) = "MAWB Deleted"
                End With
                Call LoadIORCombo(frmSetup.f10, f24)
            'Confirm shipment
            Case "IPD MAWB CONFRM"
                g_blnIPDConfirm = False
                Call ChangeIPDStatus(g_str1123, "Confirmed")
                g_frmIPDAdd.Hide
                
                Pause 5
                                
                Call LocalDocumentsIPD(g_str1123)
                
                With g_frmIPD
                    .f24 = g_frmIPDAdd.f24
                    .cboIPDStatus = "Open"
                    Call .UpdateIPDGrid("Open", .f24)
                End With
                Call LoadIORCombo(frmSetup.f10, f24)
                With g_frmIPDAdd
                    .f1297 = ""
                    .f1358 = ""
                    .f119 = ""
                    .f79 = ""
                End With

                frmShip.StatusBar1.Panels(2) = "MAWB Confirmed"
            
            
            'Delete shipment
            Case "IPD CRN DELETE "
                Call ChangeCRNStatus(g_str29)
                With g_frmIPD
                    .f24 = g_frmIPDAdd.f24
                    .cboIPDStatus = "Open"
                    Call .UpdateIPDGrid("Open", .f24)
                    Call WriteDelete(g_str29)
                    frmShip.StatusBar1.Panels(2) = "CRN Deleted"
                    StatusBar1.Panels(2) = g_str29 & " Deleted!"
                    If g_blnDeletesComplete Then
                        Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus)
                        Call SetTrackButtons
                    End If
                End With
            'Add CRN
            Case Else
                Call SaveIPDShipment(g_str29, False, g_str1123)
                
                'Save MPS trks#
                If chkDuplicate.Value = 0 And Val(g_str116) > 1 And Not g_blnMPS Then
                    For i = 2 To g_clsParser.TagCount("29")
                        Call SaveIPDShipment(g_clsParser.Tag("29", i), False, g_str1123)
                    Next
                End If
                
                Call ShipIntlCommodities(g_str1, g_str29)
                
                Call LocalDocumentsUS
                
                Call WriteReply
                
                If chkDuplicate.Value = 0 Then
                    If g_str2382 = "2" Then
                        If Not g_blnMPS And Not g_blnBatchReturn Then
                            DebugPrint "IPDReply going into Return"
                            g_blnBatchReturn = True
                            If g_str116 > 1 Then
                                Call SendMPSReturnsTrans(g_str1)
                            Else
                                If frmReturnLbl.chkOnlineRetLbl = 1 Then
                                    Call SendData(BuildOnlineReturnLabel)
                                Else
                                    Call SendData(BuildReturnLabel)
                                End If
                            End If
                        End If ' not MPS
                    End If ' g_str2382
                End If ' chkDuplicate
                
                'Added 11/04/05 to save Address if visible and checkbox checked
                If cboCustID.Visible = True And chkAddAddress = 1 Then
                    Call SaveAddress(cboCustID)
                    Call LoadAddrLookupCombos(cboCustID, cboCustID, "CustID")
                    Call LoadAddrLookupCombos(cboContact, cboContact, "f12")
                    Call LoadAddrLookupCombos(cboCompany, cboCompany, "f11")
                End If
                If Not g_blnMPS And Not g_blnBatchReturn Then
                    Call DeleteMPS(g_str1)
                    Call frmPreAssign.DeletePreAssignFromMDB(g_str1)
                    StatusBar1.Panels(2) = "Shipment Complete!"
                End If
        End Select
        'Clear screen and vars after MPS completes
        If Not g_blnMPS And Not g_blnBatchReturn Then
            Call ClearShipFields
            Call ClearGlobalVars
        End If
        Call SetLogo
    Else
        Call WriteError
        frmShip.StatusBar1.Panels(2) = "Shipment Error"
    End If
    'Make sure the IPD flag is set to the correct boolean value
    If chkIPD.Value = 0 And chkIntlIPD.Value = 0 Then
        g_blnIPD = False
    Else
        g_blnIPD = True
    End If
    
    Call EnableButtons
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:IPDReply"

End Sub
'---------------------------------------------------------------------------------------
' Module    : TrkNumReply()
' DateTime  : 3/1/2005
' Author    : Chris Elwell
' Purpose   : Handle Trk# Request Replies.
'---------------------------------------------------------------------------------------
'
Private Sub TrkNumReply()
    
    On Error GoTo EH
    
    Dim i As Integer
    Dim f1 As String        'Order ID
    Dim f28 As String       'COD Return Trk#
    Dim f29 As String       'Trk#
    Dim f526 As String      'FormID
    Dim f527 As String      'COD Return Form ID
    
    If g_str3 <> "" Then
        MsgBox g_str3, vbExclamation, "Trk# Request Error"
        frmShip.StatusBar1.Panels(2) = "Trk# Request Error"
    Else
        With g_clsParser
            For i = 0 To .TotalFields
                Select Case .Field(i)
                    Case "1"
                        f1 = .Data(i)
                    Case "28"
                        f28 = .Data(i)
                    Case "29"
                        f29 = .Data(i)
                    Case "526"
                        f526 = .Data(i)
                    Case "527"
                        f527 = .Data(i)
               End Select
            Next

            Call SavePreAssign(f1, f28, f29, f526, f527)
        End With
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:TrkNumReply"

End Sub
'---------------------------------------------------------------------------------------
' Module    : LblReprintReply()
' DateTime  : 4/25/2005
' Author    : Chris Elwell
' Purpose   : Handle Label Re-print Replies.
'---------------------------------------------------------------------------------------
'
Private Sub LblReprintReply(ByVal str29 As String)
    
    On Error GoTo EH
    
    If g_str3 <> "" Then
        MsgBox g_str3 & " : " & str29, vbExclamation, "Label Re-print Error"
        frmLblReprint.f29.BackColor = &HC0E0FF
        frmLblReprint.f29.SelStart = 0
        frmLblReprint.f29.SelLength = Len(frmLblReprint.f29)
        frmShip.StatusBar1.Panels(2) = "Label Re-print Error"
    Else
        frmLblReprint.f29 = ""
        frmLblReprint.f29.BackColor = &HC0E0FF
        StatusBar1.Panels(2) = g_str29 & " Re-printed!"
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:LblReprintReply"

End Sub
'---------------------------------------------------------------------------------------
' Module    : SavePreAssign()
' DateTime  : 3/1/2005
' Author    : Chris Elwell
' Purpose   : Inserts trk#s into PreAssign table.
'---------------------------------------------------------------------------------------
'
Private Sub SavePreAssign(ByVal f1 As String, ByVal f28 As String, _
                       ByVal f29 As String, ByVal f526 As String, ByVal f527 As String)
    
    On Error GoTo EH
    
    Dim strQuery As String
    
    If f1 <> "" Then
        strQuery = "INSERT INTO PreAssign Values (" & SingleQuotes(f1) & ","
        strQuery = strQuery + SingleQuotes(f28) & ","
        strQuery = strQuery + SingleQuotes(f29) & ","
        Select Case f526
            Case "0201"
                strQuery = strQuery + SingleQuotes("Express US Domestic") & ","
            Case "0430"
                strQuery = strQuery + SingleQuotes("Express Intl Master") & ","
            Case "0441"
                strQuery = strQuery + SingleQuotes("Express Intl MPS") & ","
            Case "0301"
                strQuery = strQuery + SingleQuotes("Express COD Master") & ","
            Case "0261"
                strQuery = strQuery + SingleQuotes("Express COD MPS") & ","
            Case "0451"
                strQuery = strQuery + SingleQuotes("Canada") & ","
            Case ""
                strQuery = strQuery + SingleQuotes("Ground/FHD") & ","
        End Select
        strQuery = strQuery + SingleQuotes(f527) & ","
        strQuery = strQuery + SingleQuotes(g_strComputerName) & ")"
        
        g_connFSMSClient.Execute strQuery
    End If
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:SavePreAssign"

End Sub
'---------------------------------------------------------------------------------------
' Module    : ShipButton()
' DateTime  : 3/16/2004
' Modified  : 2/21/2005 - Added code to ship only if function BeforeShip returns True.
' Author    : Chris Elwell
' Purpose   : Call subroutines to ship packages
'---------------------------------------------------------------------------------------
'
Public Sub ShipButton()
    Dim i As Integer
    Dim dt As Date
    
    On Error GoTo EH
                        
    If g_blnRatePending Or StatusBar1.Panels(3) = "Rating..." Then
        'Pause until reply received and parsed
        dt = Now
        Do
            If Now > DateAdd("s", 5, dt) Then Exit Do
            If g_blnRatePending Or StatusBar1.Panels(3) = "Rating..." Then
                DoEvents
                PauseMicro 10
            Else
                Exit Do
            End If
        Loop
    End If
    If g_blnRatePending Or StatusBar1.Panels(3) = "Rating..." Then
        StatusBar1.Panels(2) = "Wait for rating..."
        Exit Sub
    End If
    
    'Show Processing in status bar
    StatusBar1.Panels(2) = "Processing..."
    
    'Disable all transaction buttons
    Call DisableButtons
    
    ' Need to know in BeforeShip
    If f1.Visible Then
        g_str1 = f1                                             'Transaction ID
    Else
        g_str1 = cboCustID                                      'Transaction ID
    End If
    
    'CIC defined routine that runs before shipping the package.
    'Return True to continue shipment, False to Cancel.
    If BeforeShip Then
    
        '20070508-01 Moved call to this after BeforeShip
        Call AssignTextToGlobal
        
        With frmMPS
        
            ' 2014-09-09, JFW, Why.  This is wrecking the Ship screen.
            ' Call .UpdateMPSGrid(g_str1)
            
            If g_str1274 = "99" Then
                'Added 5/2 to save Address if visible and checkbox checked
                If cboCustID.Visible = True And chkAddAddress = 1 Then
                    Call SaveAddress(cboCustID)
                    Call LoadAddrLookupCombos(cboCustID, cboCustID, "CustID")
                    Call LoadAddrLookupCombos(cboContact, cboContact, "f12")
                    Call LoadAddrLookupCombos(cboCompany, cboCompany, "f11")
                End If
                If chkDuplicate.Value = 1 And Val(g_str116) > 1 Then
                    g_blnDeletesComplete = False
                    For i = 1 To Val(g_str116)
                        If i = Val(g_str116) Then g_blnDeletesComplete = True
                        Call ShipSmartPost
                    Next
                Else
                    Call ShipSmartPost
                End If
            '01/11/06 Added LTL
            ElseIf g_str1274 = "111" Then
                Call SendData(BuildLTLBOLTrans)
            'US Domestic
            ElseIf g_str117 = "US" And g_str50 = "US" And g_str16 <> "PR" Then
                'Build Domestic single or duplicate piece transaction then send it
                If Val(g_str116) = 1 Or chkDuplicate.Value = 1 Then
                    Call SendData(BuildDomShipTrans)
                
                'Build Domestic MPS transaction then send it
                ElseIf Val(g_str116) > 1 And chkDuplicate.Value = 0 Then
                    Call .ShipMPS
                End If
            'Added 1/27/05 for Intra-Canada
            ElseIf g_str117 = "CA" And g_str50 = "CA" Then
                If Val(g_str116) = 1 Or chkDuplicate.Value = 1 Then
                    Call SendData(BuildCADomShipTrans)
                
                'Build Domestic MPS transaction then send it
                Else
                
                    If Val(g_str116) > 1 And .g_rsMPS.RecordCount > 0 Then
                        g_str1670 = ""
                        g_str57 = ""
                        g_str58 = ""
                        g_str59 = ""
                        g_str26 = ""
                        g_str25 = ""
                        g_str3056 = ""
                        g_str3057 = ""
                        g_str3018 = ""
                        Call SendData(BuildDomMPSShipTrans(g_str1))
                    Else
                        Call SendData(BuildCADomShipTrans)
                    End If
                End If
            'US and CA Export
            Else
                If chkIPD = 1 Or chkIntlIPD = 1 Then
                    If Val(g_str116) > 1 And chkDuplicate.Value = 0 Then
                        ' 2014-01-05, JFW, Managed MPS as single pieces
                        ' Call .ShipMPS
                        Call ShipIPD
                    Else
                        Call SendData(BuildIPDShipTrans(g_str1))
                    End If
                Else
                    'Clear these if using the MPS form to process Intl MPS
                    If .g_rsMPS.RecordCount > 0 Then
                        g_str1670 = ""
                        g_str57 = ""
                        g_str58 = ""
                        g_str59 = ""
                        If Not optDocument Then g_str26 = ""
                        g_str25 = ""
                        g_str3056 = ""
                        g_str3057 = ""
                        g_str3018 = ""
                    End If
                    '03/27/06 Updated to send Build Intl doc transaction then send it
                    If optDocument Then
                        Call SendData(BuildIntlDocShipTrans(g_str1))
                    'Build Intl MPS transaction then send it
                    ElseIf optCommodities Then
                        Call SendData(BuildIntlMPSShipTrans(g_str1))
                    End If
                End If
            End If
        End With
    
        SSTab1.Tab = 0
    '20070404-02 Added Else statement to enable buttons and change status message.
    Else
        Call EnableButtons
        StatusBar1.Panels(2) = "Processing Canceled"
    End If
   
    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:ShipButton"
    If False Then
        Resume
    End If
    
End Sub

Public Sub ShipIPD()
    
    On Error GoTo EH
    Dim varTrans As Variant
    
    g_blnMPS = True
    
    For Each varTrans In BuildIPDShipTransColl(g_str1)
    
        g_blnComplete = False
            
        Call SendData(varTrans)
            
        '10/28/05 added to control flow if doing batch w/returns
        Do Until g_blnComplete And Not g_blnBatchReturn
            DoEvents
        Loop
        
        If g_str29 = "" And g_str3 = "" Then
            Err.Raise 12345, "ShipIPD", "No tracking number."
        ElseIf g_str3 <> "" Then
            GoTo Release
        End If
    
    Next varTrans
    
                If chkDuplicate.Value = 0 Then
                    If g_str2382 = "2" Then
                        DebugPrint "IPDReply going into Return"
                        g_blnBatchReturn = True
                        If g_str116 > 1 Then
                            Call SendMPSReturnsTrans(g_str1)
                        Else
                            If frmReturnLbl.chkOnlineRetLbl = 1 Then
                                Call SendData(BuildOnlineReturnLabel)
                            Else
                                Call SendData(BuildReturnLabel)
                            End If
                        End If
                    End If ' g_str2382
                End If ' chkDuplicate
    
    g_blnMPS = False
                    
    '20071026-01 Changed the following two lines to pass g_str1 instead of f1
    Call DeleteMPS(g_str1)
    StatusBar1.Panels(2) = "Shipment Complete"
    Call ClearShipFields
    Call EnableButtons
    Call ClearGlobalVars
    
Release:
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:ShipIPD"
    Resume Release

End Sub

'---------------------------------------------------------------------------------------
' Module    : Image2_Click()
' DateTime  : 3/16/2004
' Author    : Chris Elwell
' Purpose   : Show the ShipDate calendar
'---------------------------------------------------------------------------------------
'
Private Sub Image2_Click()
    Calendar1.Visible = True
End Sub
'---------------------------------------------------------------------------------------
' Module    : mnuExit_Click()
' DateTime  : 3/16/2004
' Author    : Chris Elwell
' Purpose   : Verify user wishes to Exit and shutdown if Yes.
'---------------------------------------------------------------------------------------
'
Private Sub mnuExit_Click()
    
    On Error Resume Next
    
    Dim Reply
    
    Reply = MsgBox("Are you sure you want to Exit?", vbYesNo, "Exit FSMS Client")
    
    If Reply = vbYes Then
        Unload Me
    End If

End Sub
'---------------------------------------------------------------------------------------
' Module    : mnuSetup_Click()
' DateTime  : 3/16/2004
' Author    : Chris Elwell
' Purpose   : Show Setup Password form.
'---------------------------------------------------------------------------------------
'
Private Sub mnuSetup_Click()
    frmSetupPassword.Show vbModeless, Me
End Sub
'---------------------------------------------------------------------------------------
' Module    : DisableButtons
' DateTime  : 3/16/2004
' Modified  : 10/26/2004 - Added IPD form buttons
' Author    : Chris Elwell
' Purpose   : Disables all buttons that perform functions requiring an FXRS connection.
' Call from : cmdShipAll_Click(), mnuConnect_Click(), Form_Load
'
' 2008-08-09, JFW, Bug on no net connect, this was called continueously.
'---------------------------------------------------------------------------------------
'
Public Sub DisableButtons()
    
    On Error GoTo EH
    
    Dim i As Integer
    
    Call SetMenuButton(1, False)    'Disable Delete button
    Call SetMenuButton(2, False)    'Disable Close button
    Call SetMenuButton(5, False)    'Disable Rate button
    Call SetMenuButton(6, False)    'Disable Ship button
    cmdShipAll.Enabled = False      'Disable ShipAll button on Batch tab
    cmdShipAll.BackColor = &HE0E0E0
    
    'Added 3/2/05 for Pre-Assign on menu
    mnuPreAssign.Enabled = False
    
    'Added 4/25/05 for Label Re-print
    mnuLblReprint.Enabled = False
    
    'Added 9/12/05 for Addr Verification on menu
    mnuVerifyAddress.Enabled = False
    
    '01/25/06 Added for Service Quote and Call Tag trans
    mnuQuote.Enabled = False
    mnuTags.Enabled = False

    If Left(frmSetup.f117, 2) = "US" Then
        With frmAddTags
            .cmdCreateTag.Enabled = False
            .cmdCreateTag.BackColor = &HE0E0E0
            .cmdCancelPickup.Enabled = False
            .cmdCancelPickup.BackColor = &HE0E0E0
        End With
    End If
    
    With frmMPS
        .cmdShip.Enabled = False      'Disable Ship button on MPS form
        .cmdShip.BackColor = &HE0E0E0
        If .chkPrintAsAdd = 1 Then
            .cmdAddMPS.Enabled = False
            .cmdAddMPS.BackColor = &HE0E0E0
        End If
    End With
    
    'Added 10/26/04 for IPD
    If g_frmIPD Is Nothing Then Set g_frmIPD = New frmIPD
    With g_frmIPD
        .cmdADDIPD.Enabled = False
        .cmdADDIPD.BackColor = &HE0E0E0
        .cmdConfirmIPD.Enabled = False
        .cmdConfirmIPD.BackColor = &HE0E0E0
        .cmdDeleteIPD.Enabled = False
        .cmdDeleteIPD.BackColor = &HE0E0E0
    End With
    
    'Added 7/5/05 for Return Labels
    With frmReturnLbl
        If .chkNoShipLabel = 1 Then
            For i = 0 To .cmdSave.UBound
                .cmdSave(i).Enabled = False
                .cmdSave(i).BackColor = &HE0E0E0
            Next
        End If
    End With

    Exit Sub
EH:
     
    MsgBox Err.Description, vbCritical, "frmShip:DisableButtons"
    If False Then
        Resume
    End If
    
End Sub
'---------------------------------------------------------------------------------------
' Module    : EnableButtons
' DateTime  : 3/16/2004
' Author    : Chris Elwell
' Purpose   : Enables all buttons that perform functions requiring an FXRS connection.
' Call from : cmdShipAll_Click(), wsc_Connect()
'---------------------------------------------------------------------------------------
'
Public Sub EnableButtons()
    
    On Error GoTo EH
    
    Dim i As Integer
    
    mnuConnect.Enabled = True
    
    'Updated 3/8/05 for Pre-Assign on menu. Can't IPD or duplicate pkgs
    If frmShip.chkIPD.Value = 0 And frmShip.chkIntlIPD.Value = 0 And chkDuplicate = 0 Then
        mnuPreAssign.Enabled = True
    End If
    
    'Added 4/25/05 for Label Re-print
    mnuLblReprint.Enabled = True
    
    'Added 9/12/05 for Addr Verification on menu
    mnuVerifyAddress.Enabled = True
    
    '01/25/06 Added for Service Quote and Call Tag trans
    mnuQuote.Enabled = True
    
    ' 2008-12-22, JFW, not for Canada
    If g_str117 = "CA" Then
        mnuTags.Visible = False
    Else
        mnuTags.Enabled = True
    End If
    
    With frmAddTags
        .cmdCreateTag.Enabled = True
        .cmdCreateTag.BackColor = &HC0E0FF
        .cmdCancelPickup.BackColor = &HC0E0FF
        Call .SetCancelPickupButton
    End With
    
    'If on Ship or Intl tab, enable Ship button
    If SSTab1.Tab = 0 Or SSTab1.Tab = 1 Then
        Call SetMenuButton(6, True)
    End If
    'If on Ship, Intl, or Quote tab enable Rate button
    If SSTab1.Tab = 0 Or SSTab1.Tab = 1 Then
        Call SetMenuButton(5, True)
    End If
    
    Call SetMenuButton(1, True)     'Enable Delete button
    Call SetMenuButton(2, True)     'Enable Close button
    cmdShipAll.Enabled = True       'Enable ShipAll button on Batch tab
    cmdShipAll.BackColor = &HC0E0FF
    With frmMPS
        If .chkPrintAsAdd = 0 Then      'Only enable if not printing as adding
            .cmdShip.Enabled = True     'Enable Ship button on MPS form
            .cmdShip.BackColor = &HC0E0FF
        Else
            .cmdAddMPS.Enabled = True   'Enable Add To Shipment/Print button on MPS form
            .cmdAddMPS.BackColor = &HC0E0FF
        End If
    End With
    'Added 10/26/04 for IPD
    With g_frmIPD
        .cmdADDIPD.Enabled = True
        .cmdADDIPD.BackColor = &HC0E0FF
        .cmdConfirmIPD.BackColor = &HC0E0FF
        .cmdDeleteIPD.BackColor = &HC0E0FF
        Call .SetButtons
    End With
    'Added 7/5/05 for Return Labels
    With frmReturnLbl
        If .chkNoShipLabel = 1 Then
            For i = 0 To .cmdSave.UBound
                .cmdSave(i).Enabled = True
                .cmdSave(i).BackColor = &HC0E0FF
            Next
        End If
    End With
    
    Exit Sub
EH:
     
    MsgBox Err.Description, vbCritical, "frmShip:EnableButtons"
    
End Sub
'---------------------------------------------------------------------------------------
' Module    : LoadServices
' DateTime  : 1/27/2005
' Author    : Chris Elwell
' Purpose   : Moved all code to separate Subs for US, CA and Offshore. See LoadUSServices,
'             LoadCAServices and LoadOffshoreServices below.
' Call from : f50_Change(), f50_Click(), Form_Load()
'---------------------------------------------------------------------------------------
'
Public Sub LoadServices(Optional ByVal strCurrentValue As String)
    
    On Error GoTo EH
    
    If Left(frmSetup.f117, 2) = "US" Or f1482 = 1 Then
        Call LoadUSServices(strCurrentValue)
    ElseIf Left(frmSetup.f117, 2) = "CA" Then
        Call LoadCAServices(strCurrentValue)
    '12/20/05 Added for Anywhere-to-Anywhere shipping
    Else
        Call LoadOffShoreServices(strCurrentValue)
    End If
    
    ' 2011-05-17, JFW, New for Scapa
    Call AfterLoadServices(f1274)
    
    Exit Sub
EH:
     
    MsgBox Err.Description, vbCritical, "frmShip:LoadServices"
    
End Sub


Private Sub LoadUSServices(Optional ByVal strCurrentValue As String)
    
    Dim i As Integer
    
    On Error GoTo EH
    
    'Clear services
    f1274.Clear
    'Show services based country
   
    'US Domestic
    If (Left(f50, 2) = "US" And Left(f16, 2) <> "PR") Then
        f1274.AddItem "01 - FedEx Priority Overnight"
        f1274.AddItem "05 - FedEx Standard Overnight"
        f1274.AddItem "03 - FedEx 2Day"
        f1274.AddItem "06 - FedEx First Overnight"
        f1274.AddItem "20 - FedEx Express Saver"
        f1274.AddItem "90 - FedEx Home Delivery"
        f1274.AddItem "92 - FedEx Ground"
        f1274.AddItem "70 - FedEx 1Day Freight"
        f1274.AddItem "80 - FedEx 2Day Freight"
        f1274.AddItem "83 - FedEx 3Day Freight"
        f1274.AddItem "99 - FedEx SmartPost"
        f1274.AddItem "111 - FedEx Freight Bill-of-Lading"
    ElseIf chkIPD.Value = 1 Or chkIntlIPD.Value = 1 Then
        f1274.AddItem "18 - FedEx Int'l Priority Distribution"
    'US Export
    ElseIf chkIPD.Value = 0 And chkIntlIPD.Value = 0 Then
        f1274.AddItem "01 - FedEx International Priority"
        f1274.AddItem "03 - FedEx International Economy"
        f1274.AddItem "06 - FedEx International First"
        f1274.AddItem "70 - FedEx International Priority Freight"
        f1274.AddItem "86 - FedEx International Economy Freight"
        '6/19/06 - Added to show Ground/FHD for MX and PR
        If Left(f50, 2) = "CA" Or Left(f50, 2) = "MX" Or Left(f16, 2) = "PR" Or Left(f50, 2) = "PR" Then
            f1274.AddItem "90 - FedEx Home Delivery"
            f1274.AddItem "92 - FedEx Ground"
        End If
        '20071002-01 Added to show SmartPost for
        If Left(f16, 2) = "PR" Or Left(f50, 2) = "PR" Then
            f1274.AddItem "99 - FedEx SmartPost"
        End If
    'IPD
    Else
        f1274.AddItem "18 - FedEx Int'l Priority Distribution"
    End If
    
    For i = 0 To f1274.ListCount - 1
        If strCurrentValue = Left(f1274.List(i), 2) Then
            f1274.ListIndex = i
            Exit For
        Else
            f1274.ListIndex = -1
        End If
    Next

    If f1274.ListCount = 1 Then f1274.ListIndex = 0

    Exit Sub
EH:
     
    MsgBox Err.Description, vbCritical, "frmShip:LoadUSServices"
    
End Sub
Private Sub LoadCAServices(Optional ByVal strCurrentValue As String)
    
    Dim i As Integer
    
    On Error GoTo EH
    
    'Clear services
    f1274.Clear
    'Intra CA
    If Left(f50, 2) = "CA" Then
        f1274.AddItem "01 - FedEx Priority Overnight"
        '12/19/05 Added intra-CA 2Day
        f1274.AddItem "03 - FedEx 2Day"
        f1274.AddItem "06 - FedEx First Overnight"
        ' 2011-05-06, JFW, New Domestic Economy
        f1274.AddItem "20 - FedEx Economy"
        '05/08/06 Added intra-CA Priority Freight
        f1274.AddItem "70 - FedEx Priority Freight"
        f1274.AddItem "92 - FedEx Ground"
        ' 2008-04-24, JFW, v800 for CA.
        f1274.AddItem "111 - FedEx Freight Bill-of-Lading"
    'CA IPD
    ElseIf chkIPD.Value = 1 Or chkIntlIPD.Value = 1 Then
        f1274.AddItem "18 - FedEx Int'l Priority Distribution"
    ElseIf strCurrentValue = "18" Then
        f1274.AddItem "18 - FedEx Int'l Priority Distribution"
    'CA Export
    Else
        f1274.AddItem "01 - FedEx International Priority"
        f1274.AddItem "03 - FedEx International Economy"
        f1274.AddItem "06 - FedEx International First"
        f1274.AddItem "70 - FedEx International Priority Freight"
        If Left(f50, 2) = "US" Then
            f1274.AddItem "92 - FedEx Ground"
            ' 2008-04-24, JFW, v800 for CA.
            f1274.AddItem "111 - FedEx Freight Bill-of-Lading"
        End If
    End If
    
    For i = 0 To f1274.ListCount - 1
        If strCurrentValue = Left(f1274.List(i), 2) Then
            f1274.ListIndex = i
            Exit For
        Else
            f1274.ListIndex = -1
        End If
    Next

    If f1274.ListCount = 1 Then f1274.ListIndex = 0
    
    Exit Sub
EH:
     
    MsgBox Err.Description, vbCritical, "frmShip:LoadCAServices"
    
End Sub
Private Sub LoadOffShoreServices(Optional ByVal strCurrentValue As String)
    
    Dim i As Integer
    
    On Error GoTo EH
    
    'Clear services
    f1274.Clear
    'IPD
    If chkIPD.Value = 1 Or chkIntlIPD.Value = 1 Then
        f1274.AddItem "18 - FedEx Int'l Priority Distribution"
    ElseIf strCurrentValue = "18" Then
        f1274.AddItem "18 - FedEx Int'l Priority Distribution"
    'Export
    Else
        f1274.AddItem "01 - FedEx International Priority"
        f1274.AddItem "03 - FedEx International Economy"
    End If
    
    For i = 0 To f1274.ListCount - 1
        If strCurrentValue = Left(f1274.List(i), 2) Then
            f1274.ListIndex = i
            Exit For
        Else
            f1274.ListIndex = -1
        End If
    Next

    If f1274.ListCount = 1 Then f1274.ListIndex = 0
    
    Exit Sub
EH:
     
    MsgBox Err.Description, vbCritical, "frmShip:LoadCAServices"
    

End Sub
'---------------------------------------------------------------------------------------
' Module    : LoadPackaging
' DateTime  : 1/27/2005
' Author    : Chris Elwell
' Purpose   : Moved all code to separate Subs for US and CA. See LoadUSPackaging and
'             LoadCAPackaging below.
' Call from : f50_Change(), f50_Click(), Form_Load()
'---------------------------------------------------------------------------------------
'
Public Sub LoadPackaging(Optional ByVal strCurrentValue As String)
    
    On Error GoTo EH
    
    If Not frmShip.ActiveControl Is Nothing Then
        ' debugprint "LoadPackaging 4a " & frmShip.ActiveControl.name
    End If
    
    If Left(frmSetup.f117, 2) = "US" Or f1482 = 1 Then
        Call LoadUSPackaging(strCurrentValue)
    ElseIf Left(frmSetup.f117, 2) = "CA" Then
        Call LoadCAPackaging(strCurrentValue)
    Else
        Call LoadOffShorePackaging(strCurrentValue)
    End If
    
    If Not frmShip.ActiveControl Is Nothing Then
        ' debugprint Now; "LoadPackaging 4b " & frmShip.ActiveControl.name
    End If
    Exit Sub
EH:
     
    MsgBox Err.Description, vbCritical, "frmShip:LoadPackaging"
    
End Sub
Private Sub LoadUSPackaging(Optional ByVal strCurrentValue As String)
    
    Dim i As Integer
    
    On Error GoTo EH
    
    If Not frmShip.ActiveControl Is Nothing Then
        ' debugprint "LoadUSPackaging 1 " & frmShip.ActiveControl.name
    End If
    
    'Clear packaging
    f1273.Clear
    'Show packaging based on country
    If Left(f50, 2) = "US" And Left(f16, 2) <> "PR" Then
        f1273.AddItem "01 - Your Packaging"
        f1273.AddItem "02 - FedEx Pak"
        f1273.AddItem "03 - FedEx Box"
        f1273.AddItem "04 - FedEx Tube"
        f1273.AddItem "06 - FedEx Envelope"
    Else
        f1273.AddItem "01 - Your Packaging"
        f1273.AddItem "02 - FedEx Pak"
        f1273.AddItem "03 - FedEx Box"
        f1273.AddItem "04 - FedEx Tube"
        f1273.AddItem "06 - FedEx Envelope"
        f1273.AddItem "15 - FedEx 10KG Box"
        f1273.AddItem "25 - FedEx 25KG Box"
    End If
    
    If Not frmShip.ActiveControl Is Nothing Then
        ' debugprint "LoadUSPackaging 2 " & frmShip.ActiveControl.name
    End If
    
    'Set package type to current if it is an available option
    For i = 0 To f1273.ListCount - 1
        If strCurrentValue = Left(f1273.List(i), 2) Then
            f1273.ListIndex = i
            Exit For
        Else
            f1273.ListIndex = -1
        End If
    Next

    If Not frmShip.ActiveControl Is Nothing Then
        ' debugprint "LoadUSPackaging 2 " & frmShip.ActiveControl.name
    End If
    Exit Sub
EH:
     
    MsgBox Err.Description, vbCritical, "frmShip:LoadUSPackaging"
    
End Sub
'

Private Sub LoadCAPackaging(Optional ByVal strCurrentValue As String)
    
    Dim i As Integer
    
    On Error GoTo EH
    
    ' If Not frmShip.ActiveControl Is Nothing Then debugprint "LoadCAPackaging 1 " & frmShip.ActiveControl.name
    
    'Clear packaging
    f1273.Clear
    'Show packaging based on country
    If Left(f50, 2) = "CA" Then
        f1273.AddItem "01 - Your Packaging"
        f1273.AddItem "02 - FedEx Pak"
        f1273.AddItem "03 - FedEx Box"
        f1273.AddItem "04 - FedEx Tube"
        f1273.AddItem "06 - FedEx Envelope"
    Else
        f1273.AddItem "01 - Your Packaging"
        f1273.AddItem "02 - FedEx Pak"
        f1273.AddItem "03 - FedEx Box"
        f1273.AddItem "04 - FedEx Tube"
        f1273.AddItem "06 - FedEx Envelope"
        f1273.AddItem "15 - FedEx 10KG Box"
        f1273.AddItem "25 - FedEx 25KG Box"
    End If
    
    'Set package type to current if it is an available option
    For i = 0 To f1273.ListCount - 1
        If strCurrentValue = Left(f1273.List(i), 2) Then
            f1273.ListIndex = i
            Exit For
        Else
            f1273.ListIndex = -1
        End If
    Next

    ' If Not frmShip.ActiveControl Is Nothing Then debugprint "LoadCAPackaging 3 " & frmShip.ActiveControl.name

    Exit Sub
EH:
     
    MsgBox Err.Description, vbCritical, "frmShip:LoadCAPackaging"
    
End Sub
Private Sub LoadOffShorePackaging(Optional ByVal strCurrentValue As String)
    
    Dim i As Integer
    
    On Error GoTo EH
    
    'Clear packaging
    f1273.Clear
        
    f1273.AddItem "01 - Your Packaging"
    f1273.AddItem "02 - FedEx Pak"
    f1273.AddItem "03 - FedEx Box"
    f1273.AddItem "04 - FedEx Tube"
    f1273.AddItem "06 - FedEx Envelope"
    f1273.AddItem "15 - FedEx 10KG Box"
    f1273.AddItem "25 - FedEx 25KG Box"
    
    'Set package type to current if it is an available option
    For i = 0 To f1273.ListCount - 1
        If strCurrentValue = Left(f1273.List(i), 2) Then
            f1273.ListIndex = i
            Exit For
        Else
            f1273.ListIndex = -1
        End If
    Next

    Exit Sub
EH:
     
    MsgBox Err.Description, vbCritical, "frmShip:LoadOffShorePackaging"
    
End Sub


'---------------------------------------------------------------------------------------
' Module    : AssignTextToGlobal
' DateTime  : 3/16/2004
' Author    : Chris Elwell
' Purpose   : Assigns the values on all the forms to the appropriate global shipping vars.
' Call from : ShipButton()
'---------------------------------------------------------------------------------------
'
Public Sub AssignTextToGlobal()
    
    On Error GoTo EH
    
    Dim i As Integer
    
    'Added 8/31 to support Address Book functionality
    If f1.Visible Then
        g_str1 = f1                                             'Transaction ID
        g_str12 = f12                                           'Recip Contact
        g_str11 = f11                                           'Recip Company
    Else
        g_str1 = cboCustID                                      'Transaction ID
        g_str12 = cboContact                                    'Recip Contact
        g_str11 = cboCompany                                    'Recip Company
    End If
    
    'If TransID is empty set to Manual with Date/Time stamp
    If g_str1 = "" Then
        g_str1 = "Manual_" & Format(Date, "MMDD") & Format(Time, "HHMMSS")
    End If
    
    
    g_str50 = Left(f50, 2)                                  'Recip Country Code
    g_str13 = f13                                           'Recip Addr1
    g_str14 = f14                                           'Recip Addr2
    g_str15 = f15                                           'Recip City
    g_str16 = Left(f16, 2)                                  'Recip State
    g_str17 = IIf(g_str50 = "US", Left(RemoveSpecial(f17), 5), f17)                  'Recip Zip
    g_str18 = f18                                           'Recip Phone #
    g_str440 = IIf(f440 = 1, "Y", "")                       'Residential Flag
    g_str116 = f116                                         'Number of pkgs
    '03/09/06 Modified weight to format to 2 decimal places.
    g_str1670 = Format(f1670, "##.00")                      'Weight
    g_str75 = f75                                           'Weight type
    '01/11/06 LTL Service code added
    If Left(f1274, 3) = "111" Then
        g_str1274 = "111"
        'Build Spcl Svcs multi-value field
        g_str6110 = ""
        For i = 1 To f6110.UBound
            g_str6110 = g_str6110 + IIf(f6110(i) = 1, "Y", "N")
        Next
        g_str69 = f26
        '20070605-01 added Inside P/U and Del
        g_str1120 = IIf(f1120 = 1, "Y", "")                 'Inside P/U
        g_str1121 = IIf(f1121 = 1, "Y", "")                 'Inside Del
    Else
        g_str1274 = Left(f1274, 2)                              'Service Code
    End If
    
    ' 2009-01-18, JFW
    g_str116 = f116                                         'Number of pkgs
    g_str1670 = f1670                                       'Weight
    g_str75 = f75                                           'Weight type


    g_str1273 = Left(f1273, 2)                              'Packaging
    g_str57 = IIf(IsNumeric(f57), f57, "")            'Dim H
    g_str58 = IIf(IsNumeric(f58), f58, "")            'Dim W
    g_str59 = IIf(IsNumeric(f59), f59, "")            'Dim L
    
    
    g_str24 = f24                                           'Ship Date
    
    g_str26 = f26                                           'Declared Value
    g_str68 = f68                                           'Currency Type
    g_str23 = Left(f23, 1)                                  'Payment Type
    g_str20 = f20                                           'Bill-To Acct#

    ''06/01/06 removed cboDept
    g_str38 = f38                                           'Deparment Code
    
    g_str25 = f25                                           'References
    'Special svcs
    g_str1332 = IIf(f1332(0) = 1 Or f1332(1) = 1, "Y", "")              'Alcohol Flag
    '01/11/06 Updated with f27(3) for LTL
    g_str27 = IIf(f27(0) = 1 Or f27(1) = 1 Or f27(2) = 1 Or f27(3) = 1, "Y", "")      'COD Flag
    g_str1268 = IIf(f1268(0) = 1 Or f1268(1) = 1 Or f1268(2) = 1 Or f1268(3) = 1, "Y", "")              'Dry Ice Flag
    ' 2009-06-03, JFW, Fix for CA HAL
    ' g_str1200 = IIf(f1200(0) = 1 Or f1200(1) = 1, "Y", "")              'Hal Flag
    g_str1200 = IIf(f1200(0) = 1 Or f1200(1) = 1 Or f1200(2) = 1 Or f1200(3) = 1, "Y", "")              'Hal Flag
    
    '01/20/06 Updated with f1266(2) for CA to US Sat Del
    g_str1266 = IIf(f1266(0) = 1 Or f1266(1) = 1 Or f1266(2) = 1, "Y", "")              'Sat Del Flag
    
    '11/21/05 Changed to Exit For from Exit Sub
    For i = 0 To f1208.UBound
        If f1208(i) = 1 Then
            g_str1208 = "Y"                                 'Signature Services
            Exit For
        End If
    Next
    
    g_str3018 = IIf(f3018(0) = 1 Or f3018(1) = 1, "Y", "")  'Non-Standard pkg
    If f3020(0) = 1 Then                                    'FHD Special SVCs
        g_str3020 = "1"
    ElseIf f3020(1) = 1 Then
        g_str3020 = "2"
    ElseIf f3020(2) = 1 Then
        g_str3020 = "3"
    Else
        g_str3020 = ""
    End If
    
    g_str3056 = f3056                                       'Pkg P.O. #
    g_str3057 = f3057                                       'Pkg Invoice #

    'US or CA Export
    If (g_str117 = "US" And (Left(f50, 2) <> "US" Or Left(f16, 2) = "PR")) Or _
        (g_str117 = "CA" And Left(f50, 2) <> "CA") Then
        
        
        'Added 7/22/05 for Admissibility pkg type for US to CA, CA to US
        If g_str1273 = "01" And (g_str50 = "US" Or g_str50 = "CA") Then
            g_str1958 = Left(f1958, 3)
        Else
            g_str1958 = ""
        End If
        
        g_str1090 = f1090                                   'Rate Currency
        If optDocument Then
            g_str190 = "Y"                                  'Document flag
            g_str79 = f79Doc                                'Document Type
            g_str80 = Left(f80(1), 2)                       'Country of Manufacture
        Else
            g_str190 = ""
            g_str70 = Left(f70, 1)                          'Duty/Tax Pay Type
            g_str71 = f71                                   'Duty/Tax Acct#
            g_str73 = IIf(f73 = 1, "Y", "")                 'Parties Related Flag
            
            '02/07/06 updated for new SED/EEI Implementation
            If g_str117 = "US" Then
                g_str1358 = IIf(opt1358(0) And cbo1358 <> "[Please Select]", cbo1358, f1358)  'FTR Exemption # or AES Citation #
            Else
                g_str118 = f1358                            'IRS/EIN/VAT #
            End If
            
            
            g_str413 = IIf(f413 = 1, "Y", "N")              'Broker Select
            If g_str113 = "Y" Then                          'CI Flag
                g_str72 = Left(f72, 1)                      'Terms of Sale
                g_str532 = f532                             'CI Freight Charge
                g_str533 = f533                             'CI Insurance Charge
                If Val(f534) > 0 Then
                    g_str534 = f534                         'CI Other Charge
                    g_str1357 = Left(f1357, 2)              'CI Other Chg Type
                End If
                g_str418_1 = f418(1)                        'CI Comment 1
                g_str418_2 = f418(2)                        'CI Comment 2
                g_str418_3 = f418(3)                        'CI Comment 3
            End If
            g_str1174 = IIf(f1174(0) = 1 Or f1174(1) = 1, "Y", "")             'Broker Select
        End If
    End If
    
    'Added 4/6/2005
    If g_str1274 = "99" Then
        g_strClass = Left(cboClass, 1)
        g_strSubClass = Left(cboSubClass, 1)
        '07/16/06 Added for Del Confirm
        If g_strClass <> "A" Or chkNoDelConfirm = 0 Then
            g_blnNoDelConfirm = False
        Else
            g_blnNoDelConfirm = True
        End If
        '09/18/06 Added for Ancillary endorsements
        g_strEndorsement = Mid(cboEndorsement, 5)
        
    End If
        
    DebugPrint "frmShip.AssignTextToGlobal g_str1355 " & g_str1355 & " f1355 " & f1355.Text
    
    '01/16/06 Added Intl IPD
    If chkIPD = 1 Or chkIntlIPD = 1 Then
        g_str1355 = f1355
    Else
        g_str1355 = ""
    End If
    
    '01/20/06 Added Sig Rel for Intra-CA
    If f51 = 1 Then
        g_str51 = "Y"
        g_str1118 = f1118
    Else
        g_str51 = ""
        g_str1118 = ""
    End If
    
    If f2382(0) = 1 Then
        g_str2382 = "2"
    Else
        g_str2382 = ""
    End If
    
    If f1331(1) = 1 And g_str1274 = "92" Then g_str1331 = "Y"
    
    '20080123-01 Added for Priority Alert
    g_str1209 = IIf(f1209 = 1, "Y", "")
    
    g_str1222 = f1222                                       '2012-06-12, RSANTOSf, Bombardier & P&W Tracking number
    
    If chkETD(0) = 1 Or chkETD(1) = 1 Then
        Call frmETD.AssignFormGlobalVars
    Else
        g_strETD = ""
    End If
    
    Exit Sub
    
EH:
    MsgBox Err.Description, vbCritical, "frmShip:AssignTextToGlobal"
    
End Sub



'---------------------------------------------------------------------------------------
' Module    : AssignTransToGlobal
' DateTime  : 3/16/2004
' Author    : Chris Elwell
' Purpose   : Assigns the values on all the forms to the appropriate global shipping vars.
' Call from : ShipButton()
'---------------------------------------------------------------------------------------
'
Public Function AssignTransToGlobal(ByVal strTransIn As String) As Boolean
    
    On Error GoTo EH
    
    Dim strTrans() As String
    Dim i As Integer
    
    strTransIn = Replace(strTransIn, ",""", """")
    strTrans = Split(strTransIn, """")
    
    If LBound(strTrans) < UBound(strTrans) Then
        i = LBound(strTrans)
        Do
            If i >= UBound(strTrans) Then Exit Do
            Select Case strTrans(i)
            Case "0"
                g_str0 = strTrans(i + 1)
            Case "1"
                g_str1 = strTrans(i + 1)
            Case "12"
                g_str12 = strTrans(i + 1)
            Case "11"
                g_str11 = strTrans(i + 1)
            Case "13"
                g_str13 = strTrans(i + 1)
            Case "14"
                g_str14 = strTrans(i + 1)
            Case "15"
                g_str15 = strTrans(i + 1)
            Case "16"
                g_str16 = strTrans(i + 1)
            Case "17"
                g_str17 = strTrans(i + 1)
            Case "18"
                g_str18 = strTrans(i + 1)
            Case "29"
                g_str29 = strTrans(i + 1)
            Case "50"
                g_str50 = strTrans(i + 1)
            Case "440"
                g_str440 = strTrans(i + 1)
            Case "116"
                g_str116 = strTrans(i + 1)
            Case "1670"
                g_str1670 = strTrans(i + 1)
            Case "75"
                g_str75 = strTrans(i + 1)
            Case "1274"
                g_str1274 = strTrans(i + 1)
            Case "6110"
                g_str6110 = strTrans(i + 1)
            Case "69"
                g_str69 = strTrans(i + 1)
            Case "1120"
                g_str1120 = strTrans(i + 1)
            Case "1121"
                g_str1121 = strTrans(i + 1)
            Case "1273"
                g_str1273 = strTrans(i + 1)
            Case "57"
                g_str57 = strTrans(i + 1)
            Case "58"
                g_str58 = strTrans(i + 1)
            Case "59"
                g_str59 = strTrans(i + 1)
            Case "24"
                g_str24 = strTrans(i + 1)
                If g_str24 < Format(Date, "yyyymmdd") Then
                    g_str24 = Format(Date, "yyyymmdd")
                End If
            Case "26"
                g_str26 = strTrans(i + 1)
            Case "26"
                g_str68 = strTrans(i + 1)
            Case "23"
                g_str23 = strTrans(i + 1)
            Case "20"
                g_str20 = strTrans(i + 1)
            Case "38"
                g_str38 = strTrans(i + 1)
            Case "25"
                g_str25 = strTrans(i + 1)
            Case "1332"
                g_str1332 = strTrans(i + 1)
            Case "27"
                g_str27 = strTrans(i + 1)
            Case "1268"
                g_str1268 = strTrans(i + 1)
            Case "1200"
                g_str1200 = strTrans(i + 1)
            Case "1266"
                g_str1266 = strTrans(i + 1)
            Case "1208"
                g_str1208 = strTrans(i + 1)
            Case "3018"
                g_str3018 = strTrans(i + 1)
            Case "3020"
                g_str3020 = strTrans(i + 1)
            Case "3056"
                g_str3056 = strTrans(i + 1)
            Case "3057"
                g_str3057 = strTrans(i + 1)
            Case "1"
                g_str1958 = strTrans(i + 1)
            Case "1090"
                g_str1090 = strTrans(i + 1)
            Case "190"
                g_str190 = strTrans(i + 1)
            Case "79"
                g_str79 = strTrans(i + 1)
            Case "80"
                g_str80 = strTrans(i + 1)
            Case "70"
                g_str70 = strTrans(i + 1)
            Case "71"
                g_str71 = strTrans(i + 1)
            Case "73"
                g_str73 = strTrans(i + 1)
            Case "1358"
                g_str1358 = strTrans(i + 1)
            Case "118"
                g_str118 = strTrans(i + 1)
            Case "413"
                g_str413 = strTrans(i + 1)
            Case "72"
                g_str72 = strTrans(i + 1)
            Case "532"
                g_str532 = strTrans(i + 1)
            Case "533"
                g_str533 = strTrans(i + 1)
            Case "534"
                g_str534 = strTrans(i + 1)
            Case "1357"
                g_str1357 = strTrans(i + 1)
            Case "418"
                g_str418_1 = strTrans(i + 1)
            Case "418-1"
                g_str418_1 = strTrans(i + 1)
            Case "418-2"
                g_str418_2 = strTrans(i + 1)
            Case "418-3"
                g_str418_3 = strTrans(i + 1)
            Case "1174"
                g_str1174 = strTrans(i + 1)
            Case "1355"
                g_str1355 = strTrans(i + 1)
            Case "51"
                g_str51 = strTrans(i + 1)
            Case "1118"
                g_str1118 = strTrans(i + 1)
            Case "2382"
                g_str2382 = strTrans(i + 1)
            Case "1331"
                g_str1331 = strTrans(i + 1)
            Case "1209"
                g_str1209 = strTrans(i + 1)
            End Select
            i = i + 2
        Loop
    End If
    AssignTransToGlobal = True
    Exit Function
EH:
     
    MsgBox Err.Description, vbCritical, "frmShip:AssignTransToGlobal"
    
End Function


'---------------------------------------------------------------------------------------
' Module    : SendMPSReturnsTrans
' DateTime  : 9/19/2006
' Author    : Chris Elwell
' Purpose   : Called when doing return labels with MPS
'---------------------------------------------------------------------------------------
'
Private Sub SendMPSReturnsTrans(ByVal str1 As String)

    On Error GoTo EH
    
    Dim rsMPS As New ADODB.Recordset
    Dim strQuery As String
    
    ' Need to copy Commodities from shipment to return

    ' 2009-02-10, JFW, Keep MPS packages sorted.
    strQuery = "SELECT g_str1670 FROM MPS WHERE f1 = '" & str1 & "' ORDER BY ShipDate"
    rsMPS.Open strQuery, g_connFSMSClient, adOpenKeyset, adLockOptimistic
    
    Do Until rsMPS.EOF
        g_str1670 = rsMPS!g_str1670
        
        g_blnComplete = False
        
        If frmReturnLbl.chkOnlineRetLbl = 1 Then
            Call SendData(BuildOnlineReturnLabel)
        Else
            Call SendData(BuildReturnLabel)
        End If
        
        Do Until g_blnComplete
            DoEvents
        Loop
    
        rsMPS.MoveNext
    Loop
    
    Call DeleteMPS(str1)
    If frmMPS.chkPrintAsAdd = 0 Then
        Call frmReturnLbl.ClearOnlineTab
        Call frmPreAssign.DeletePreAssignFromMDB(str1)
        Call ClearShipFields
        Call ClearGlobalVars
    End If

Release:
    If rsMPS.State = adStateOpen Then rsMPS.Close
    Set rsMPS = Nothing
    
    Exit Sub
EH:
     
    MsgBox Err.Description, vbCritical, "frmShip:SendMPSReturnsTrans"
    Resume Release
    
End Sub
'---------------------------------------------------------------------------------------
' Module    : SendDuplicateReturns
' DateTime  : 9/19/2006
' Author    : Chris Elwell
' Purpose   : Called when doing return labels with MPS
'---------------------------------------------------------------------------------------
'
Private Sub SendDuplicateReturns(ByVal str116 As String)

    Dim i As Integer

    For i = 1 To str116
        
        g_blnComplete = False
        
        If frmReturnLbl.chkOnlineRetLbl = 1 Then
            Call SendData(BuildOnlineReturnLabel)
        Else
            Call SendData(BuildReturnLabel)
        End If
        
        Do Until g_blnComplete
            DoEvents
        Loop
    Next
    
    g_intDupCount = 1
    Call frmReturnLbl.ClearOnlineTab
    Call frmPreAssign.DeletePreAssignFromMDB(g_str1)
    Call DeleteIntlCommodities(g_str1)
    Call ClearShipFields
    Call ClearGlobalVars
    Call SetLogo

End Sub
'---------------------------------------------------------------------------------------
' Module    : ClearShipFields
' DateTime  : 3/16/2004
' Modified  : 3/17/2006 Changed to Select Case to reduce code. Added Email Alert fields
' Author    : Chris Elwell
' Purpose   : Clears most shipping related fields
'---------------------------------------------------------------------------------------
'
Public Sub ClearShipFields()
    Dim MyForm As Form
    Dim MyControl As Control
    Dim i As Integer
    Dim j As Integer
    
    On Error GoTo EH
    
'    f1.Enabled = True
'    cboCustID.Enabled = True
    
    'Clear all text fields except Current Sender fields, ShipDate, and temp transin/transout fields
    For Each MyForm In Forms
        If MyForm.name <> "frmSetup" And MyForm.name <> "frmIPDAdd" And MyForm.name <> "frmReturnLbl" _
            And MyForm.name <> "frmADGIDG" And MyForm.name <> "frmDG" And MyForm.name <> "frmDebug" And MyForm.name <> "frmAddTags" _
            And Left(MyForm.name, 7) <> "frmCust" Then '20071030-02 Added for custom forms
            For Each MyControl In MyForm.Controls
                If TypeOf MyControl Is TextBox Then
                    Select Case MyControl.name
                        Case "f24", "txtBatchFilename", "txtTotalRecords", _
                            "txtNumShipped", "txtNumErrors", "txtShipDate", "f9", "f484"
                        Case "f116", "txtNoPkgs"
                            MyControl = "1"
                        Case "f57"
                            MyControl = " H "
                        Case "f58"
                            MyControl = " W "
                        Case "f59"
                            MyControl = " L "
                        Case Else
                            MyControl = ""
                    End Select
                End If
                If TypeOf MyControl Is CheckBox Then
                    If MyControl.name <> "chkIPD" And MyControl.name <> "chkIntlIPD" And MyControl.name <> "chkBatchErrorCheck" _
                        And MyControl.name <> "f1482" And MyControl.name <> "chkAddAddress" Then
                            MyControl = 0
                    End If
                End If
                If TypeOf MyControl Is ComboBox Then
                    Select Case MyControl.name
                        'Don't clear these combos
                        Case "cboLocationName", "cboSearchField", "cboBatchProfile", "f1355", "cboIPDStatus", _
                            "f75", "cboShipmentType", "cboShipmentStatus", "f1555", "f1558", "1552", "f1965", _
                            "f1967", "f1964", "f1552", "f8"
                        ' 2010-04-27, JFW, Default US, this is not right.
                        'Case "f50", "f80"
                        '    If Not g_blnIPD Then
                        '        MyControl = "US"
                        '    End If
                        Case "f23", "f68", "f1090"
                            MyControl.ListIndex = 0
                        Case Else
                            If MyControl.Style = 0 Then
                                MyControl = ""
                            Else
                                MyControl.ListIndex = -1
                            End If
                    End Select
                End If
            Next
        End If
    Next
    
    For Each MyForm In Forms
        If MyForm.name = "frmMPS" Then
            Unload MyForm
        End If
        Debug.Print MyForm.name
        
    Next MyForm
    
    ' 2010-04-30, JFW, Rate quote going here, don't clear it after shipment
    'Clear batch error message from Status bar
    ' StatusBar1.Panels(3) = ""
    
    'Updated 3/2/05 for Address book shipping
    Call SetCommodSummary
                
    'Added 12/3 to support non-FXRS custom label fields
    For i = 0 To 9
        For j = 0 To 9
            g_strCUST(i, j) = ""
        Next
    Next
    
    'Set focus to OrderID Or cboCustID
    If f1.Visible Then
        '10/6/05 only set focus If locked
        If f1.Enabled Then f1.SetFocus
    Else
        '10/6/05 only set focus If locked
        If cboCustID.Enabled Then cboCustID.SetFocus
    End If
    
    'Reset chkAddAddress caption to Add
    chkAddAddress.Caption = "Add To Address Book"
    
    'Clear optimization boolean
    g_blnDoOptimize = False
    
    'Added 7/8/05 to clear RMA# on Return Lbl form
    frmReturnLbl.f2210 = ""
    
    '9/8/05 Set ship field colors to white
    Call frmVerifyAddress.SetShipFieldsBackColor(vbWhite, False)
    
    '05/11/06
    cmdMPS.Enabled = MPSButtonEnable

    ' 2010-04-30, JFW, Call ODBC module to restore customer defaults
    Call ClearShipScreen
    
    Exit Sub
EH:
     
    MsgBox Err.Description, vbCritical, "frmShip:ClearShipFields"
    
End Sub
'---------------------------------------------------------------------------------------
' Module    : AddCommodityToMDB
' DateTime  : 3/16/2004
' Modified  : 3/17/2005 - Removed Date and added Part Number f1275
' Author    : Chris Elwell
' Purpose   : Adds a commodity to IntlMPS for the current OrderID
' Call from : cmdAddToShipment_Click()
'---------------------------------------------------------------------------------------
'
Public Sub AddCommodityToMDB()
    Dim strInsertQuery As String
    Dim str414 As String
    
    On Error GoTo EH
    
    'Get Unit of Measure
    If InStr(f414, " ") > 0 Then
        str414 = Left(f414, InStr(1, f414, " ") - 1)
    Else
        str414 = f414
    End If
    
    strInsertQuery = "INSERT INTO IntlCommodities"
    strInsertQuery = strInsertQuery & " ( f1,g_str77,g_str79,g_str80,g_str81,g_str82,g_str83,g_str84,g_str414,g_str1030,g_str78,g_str1275,Workstation,g_str120 "
    If Not g_frmCommodityMore Is Nothing Then
        strInsertQuery = strInsertQuery & ", MID, Document1, Document2, Document3"
    End If
    If NASCAR_VERSION >= "FSMSClient v800.2.2" Then
        strInsertQuery = strInsertQuery & ", CommodityID"
    End If
    strInsertQuery = strInsertQuery & " ) VALUES ( "

    'Added 3/1/05 to support Address Book
    If f1.Visible Then
        strInsertQuery = strInsertQuery + SingleQuotes(f1) + ","
    Else
        strInsertQuery = strInsertQuery + SingleQuotes(cboCustID) + ","
    End If
    strInsertQuery = strInsertQuery + SingleQuotes(f77) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(f79) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(Left(f80(0), 2)) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(f81) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(f82) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(f83) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(f84) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(str414) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(f1030) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(f78) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(f1275) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_strComputerName) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(f120)
    
    If Not g_frmCommodityMore Is Nothing Then
        strInsertQuery = strInsertQuery & ", " & SingleQuotes(g_frmCommodityMore.cboMID.Text)
        strInsertQuery = strInsertQuery & ", " & SingleQuotes(g_frmCommodityMore.cboDocument1.Text)
        strInsertQuery = strInsertQuery & ", " & SingleQuotes(g_frmCommodityMore.cboDocument2.Text)
        strInsertQuery = strInsertQuery & ", " & SingleQuotes(g_frmCommodityMore.cboDocument3.Text)
    End If
    
    If NASCAR_VERSION >= "FSMSClient v800.2.2" Then
        strInsertQuery = strInsertQuery & ", " & SingleQuotes(cboCommodityID.Text)
    End If
    
    strInsertQuery = strInsertQuery + " )"
    
    DebugPrint strInsertQuery
    
    g_connFSMSClient.Execute strInsertQuery
    
    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:AddCommodityToMDB"
End Sub
'---------------------------------------------------------------------------------------
' Module    : CalcCustomsValue
' DateTime  : 3/16/2004
' Author    : Chris Elwell
' Purpose   : Calculates a Commodity customs value by multiplying the number of units
'             the unit value.
' Call from : f1030_LostFocus(), f82_LostFocus()
'---------------------------------------------------------------------------------------
'
Private Sub CalcCustomsValue()
    '04/04/06 calculate even if f78 has a value
    If Val(f82) <> 0 And Val(f1030) <> 0 Then 'And Val(f78) = 0 Then
        '11/21/05 Changed to Format command since some values can have exponents
        f78 = Format(Val(f82) * Val(f1030), "#.#0")
    End If
End Sub
'---------------------------------------------------------------------------------------
' Module    : CalcUnitValue
' DateTime  : 5/5/2005
' Author    : Chris Elwell
' Purpose   : Calculates a Commodity Unit Value by dividing the Customs Val by the number of units
'             number of units.
' Call from : f78_LostFocus(), f82_LostFocus()
'---------------------------------------------------------------------------------------
'
Private Sub CalcUnitValue()
    '04/04/06 calculate even if f1030 has a value
    If Val(f82) <> 0 And Val(f78) <> 0 Then 'And Val(f1030) = 0 Then
        '11/21/05 Changed to Format command since some values can have exponents
        f1030 = Format(Val(f78) / Val(f82), "#.#####0")
    End If
End Sub

'---------------------------------------------------------------------------------------
' Module    : ClearCommodityFields
' DateTime  : 3/16/2004
' Author    : Chris Elwell
' Purpose   : Clears commoidty fields on International tab
' Call from : cmdAddToShipment_Click()
'---------------------------------------------------------------------------------------
'
Private Sub ClearCommodityFields()

    cboCommodityID.ListIndex = -1
    f77 = ""
    f79 = ""
    f81 = ""
    f80(0) = ""
    f82 = ""
    f78 = ""
    f414 = ""
    f1030 = ""
    f1275 = ""
    f120 = ""
    txtCommodityWgt = ""

    Call ClearCommodity
    
End Sub
'---------------------------------------------------------------------------------------
' Module    : LoadCommodities
' DateTime  : 3/16/2004
' Author    : Chris Elwell
' Purpose   : Loads commodity IDs saved in the Commodity table into the cboCommodityID combo box
' Call from : SSTabg1_Click
'---------------------------------------------------------------------------------------
'
Public Sub LoadCommodities()
    Dim rsQuery As String
    Dim rsCommodity As ADODB.Recordset
    
    On Error GoTo EH
    
    'Get recordset of Commodity IDs
    Set rsCommodity = New ADODB.Recordset
    rsQuery = "SELECT CommodityID FROM Commodity ORDER BY 1"
    rsCommodity.Open rsQuery, g_connFSMSClient, adOpenKeyset, adLockOptimistic
    
    'Clear combo and add all Commodity IDs
    cboCommodityID.Clear
    Do While Not rsCommodity.EOF
        cboCommodityID.AddItem rsCommodity("CommodityID")
        rsCommodity.MoveNext
    Loop

Release:
    If rsCommodity.State = adStateOpen Then
        rsCommodity.Close
    End If
    Set rsCommodity = Nothing

    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:LoadCommodities"
     Resume Release
     
End Sub
'---------------------------------------------------------------------------------------
' Module    : ShowSpecialSvcs
' DateTime  : 3/16/2004
' Modified  : 10/21/2004 - added support for IPD
'           : 12/14/2005 - added call to EnableSpecialFrame
' Author    : Chris Elwell
' Purpose   : Show the special services for the selected service and set the correct Email
'             fields to show on frmEmail.
' Call from : f1274_Change(), f1274_Click(), f50_Change(), f50_Click()
'---------------------------------------------------------------------------------------
'
Public Sub ShowSpecialSvcs()
    On Error GoTo EH
    
    Dim i As Integer
    
    Call DisableNonSPFields(False)
    
    If Left(frmSetup.f117, 2) = "US" Or f1482 = 1 Then
        'US Export
        If Left(f50, 2) <> "US" Or Left(f16, 2) = "PR" Then
            'US to CA Ground
            If Left(f50, 2) = "CA" And Left(f1274, 2) = "92" Then
                Call EnableSpecialFrame(1)
            'US to CA FHD
            ElseIf Left(f50, 2) = "CA" And Left(f1274, 2) = "90" Then
                Call EnableSpecialFrame(2)
            '20071002-01 US to PR SmartPost
            ElseIf Left(f1274, 2) = "99" And (Left(f16, 2) = "PR" Or Left(f50, 2) = "PR") Then
                Call EnableSpecialFrame(7)
                Call DisableNonSPFields(True)
            'US Export
            Else
                Call EnableSpecialFrame(3)
                'IPD - shows IPD checkbox and View/Edit button with Int'l
                With frmSetup
                    If .chkIPD = 1 Then
                        chkIPD.Visible = True
                        cmdViewIPD.Visible = True
                        '12/22/05 for INTL IPD
                        chkIntlIPD.Visible = True
                        cmdViewIntlIPD.Visible = True
                    Else
                        chkIPD.Visible = False
                        chkIPD = 0
                        cmdViewIPD.Visible = False
                        '12/22/05 for INTL IPD
                        chkIntlIPD.Visible = False
                        chkIntlIPD = 0
                        cmdViewIntlIPD.Visible = False
                    End If
                End With
            End If
        'US Domestic
        Else
            'US Dom Ground
            If Left(f1274, 2) = "92" Then
                Call EnableSpecialFrame(1)
            'US Dom FHD
            ElseIf Left(f1274, 2) = "90" Then
                Call EnableSpecialFrame(2)
            'US Dom SmartPost
            ElseIf Left(f1274, 2) = "99" Then
                Call EnableSpecialFrame(7)
                Call DisableNonSPFields(True)
            'US Dom LTL BOL
            ElseIf Left(f1274, 3) = "111" Then
                Call EnableSpecialFrame(8)
            'US Dom Express
            Else
                Call EnableSpecialFrame(0)
            End If
        End If
    'CA
    ElseIf g_str117 = "CA" Then
        If Left(f1274, 3) = "111" Then
            'CA LTL BOL
            Call EnableSpecialFrame(8)
        ElseIf Left(f50, 2) <> "CA" Then
            'CA Export
            Call EnableSpecialFrame(6)
            f1266(2).Visible = IIf(Left(f50, 2) = "US", True, False)
        Else
            'Intra CA Ground
            If Left(f1274, 2) = "92" Then
                Call EnableSpecialFrame(4)
            'Intra CA Express
            Else
                Call EnableSpecialFrame(5)
            End If
        End If
    '12/20/05 Anywhere-to-Anywhere
    Else
        'Same as CA Export
        Call EnableSpecialFrame(6)
    End If
    
    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:ShowSpecialSvcs"

End Sub
Private Sub EnableSpecialFrame(ByVal intIndex As Integer)
    
    Dim i As Integer
    
    For i = 0 To fraSpecial.UBound
        fraSpecial(i).Visible = IIf(i = intIndex, True, False)
    Next

End Sub
'---------------------------------------------------------------------------------------
' Module    : CalcTotalWgt
' DateTime  : 3/16/2004
' Author    : Chris Elwell
' Purpose   : Calculate the total weight for a commodity
' Call from : f82_LostFocus() and txtCommodityWgt_LostFocus()
'---------------------------------------------------------------------------------------
'
Private Sub CalcTotalWgt()
    Dim strTemp As String
    
    On Error GoTo EH
    
    '04/04/06 calculate even if f77 has a value
    If Val(f82) <> 0 And Val(txtCommodityWgt) <> 0 Then 'And Val(f77) = 0 Then
        f77 = Format(Str(Val(f82) * Val(txtCommodityWgt)), "##0.00")
    End If
    
    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:CalcTotalWgt"
End Sub
'---------------------------------------------------------------------------------------
' Module    : UpdateShipmentsGrid
' DateTime  : 3/17/2004
' Modified  : 8/10/2004, 3/14/2005
' Changes   : Modified for new cboShipmentType & cboShipmentStatus.
' Author    : Chris Elwell
' Purpose   : Load Shipments into lstTransactions on Shipped List tab.
' Call from : ChangeStatusToDelete, SSTab1_Click, txtShipDate_LostFocus
'---------------------------------------------------------------------------------------
'
Public Sub UpdateShipmentsGrid(ByVal strType As String, ByVal strStatus As String, _
                                Optional ByVal strField As String, Optional ByVal strValue As String, _
                                Optional ByVal strSortField As String, Optional ByVal strDirection As String)
    Dim rsQuery As String
    Dim i As Integer
    Dim strShipment As String
    Dim strHeading As String
    Dim strAcctNum As String
    Dim rsAcctNum As New ADODB.Recordset
    
    On Error GoTo EH
    
    'debugprint "UpdateShipmentsGrid"
    
    If strStatus = "Shipped" Then
        strHeading = "Total Packages: "
    Else
        strHeading = "Total Deleted: "
    End If
    
    'Get acct# for query
    If cboLocationName(1) = frmSetup.cboName Then
        strAcctNum = frmSetup.f10
    ElseIf cboLocationName(1) <> "" Then
        rsQuery = "SELECT f10 FROM Meters WHERE Name = " & SingleQuotes(cboLocationName(1))
        rsAcctNum.Open rsQuery, g_connFSMSClient, adOpenKeyset, adLockOptimistic
        If Not rsAcctNum.EOF Then
            strAcctNum = rsAcctNum!f10
        End If
        rsAcctNum.Close
    End If
    'Convert strField to actual field name in Shipments table of FSMSClient.mdb
    If strField <> "" Then
        strField = GridCaptionToFieldName(strField)
    End If
    'If Sort field is blank set to tracking number else convert to fieldname
    If strSortField = "" Then
        strSortField = "g_str29"
    Else
        strSortField = GridCaptionToFieldName(strSortField)
    End If
    
    'If Sort direction is blank set to DESC
    If strDirection = "" Then
        strDirection = "DESC"
    End If
    
    'Build queries for service type
    Select Case strType
        Case "ALL", ""
            rsQuery = "SELECT g_str29,g_str1123,g_str1,g_str25,g_str11,"
            rsQuery = rsQuery + "g_str12,g_str13,g_str15,g_str16,g_str17,g_str50"
            rsQuery = rsQuery + " FROM Shipments WHERE Status = " & SingleQuotes(strStatus)
            lblShipmentsView = "All FedEx Express && Ground Shipments"
        Case "ALL Domestic"
            rsQuery = "SELECT g_str29,g_str1123,g_str1,g_str25,g_str11,"
            rsQuery = rsQuery + "g_str12,g_str13,g_str15,g_str16,g_str17,g_str50"
            rsQuery = rsQuery + " FROM Shipments WHERE Status = " & SingleQuotes(strStatus)
            rsQuery = rsQuery + " AND g_str50 = " & SingleQuotes(g_str117) & " AND g_str16 <> 'PR'"
            lblShipmentsView = "FedEx Express && Ground Domestic"
        Case "ALL Int'l"
            'Build Express Int'l Query
            rsQuery = "SELECT g_str29,g_str1123,g_str1,g_str25,g_str11,g_str12,"
            rsQuery = rsQuery + "g_str13,g_str15,g_str16,g_str17,g_str50"
            rsQuery = rsQuery + " FROM Shipments WHERE Status = " & SingleQuotes(strStatus)
            rsQuery = rsQuery + " AND g_str1274 <> '90' AND g_str1274 <> '92'"
            rsQuery = rsQuery + " AND (g_str50 <> " & SingleQuotes(g_str117) & " OR g_str16 = 'PR')"
            lblShipmentsView = "FedEx Express && Ground International"
        Case "ALL TD"
            'Build Express Int'l Query
            rsQuery = "SELECT g_str29,g_str1123,g_str1,g_str25,g_str11,"
            rsQuery = rsQuery + "g_str12,g_str13,g_str15,g_str16,g_str17"
            rsQuery = rsQuery + " FROM TD WHERE Status = " & SingleQuotes(strStatus)
            ' rsQuery = rsQuery + " AND g_str1274 <> '90' AND g_str1274 <> '92'"
            ' rsQuery = rsQuery + " AND (g_str50 <> " & SingleQuotes(g_str117) & " OR g_str16 = 'PR')"
            lblShipmentsView = "FedEx TD to US"
        Case "Express Domestic"
            'Build Domestic Express Query
            rsQuery = "SELECT g_str29,g_str1123,g_str1,g_str25,g_str11,"
            rsQuery = rsQuery + "g_str12,g_str13,g_str15,g_str16,g_str17"
            rsQuery = rsQuery + " FROM Shipments WHERE Status = " & SingleQuotes(strStatus)
            rsQuery = rsQuery + " AND g_str1274 <> '90' AND g_str1274 <> '92'"
            rsQuery = rsQuery + " AND g_str50 = " & SingleQuotes(g_str117) & " AND g_str16 <> 'PR'"
            lblShipmentsView = "FedEx Express Domestic"
        Case "Express Int'l"
            'Build Express Int'l Query
            rsQuery = "SELECT g_str29,g_str1123,g_str1,g_str25,g_str11,g_str12,"
            rsQuery = rsQuery + "g_str13,g_str15,g_str16,g_str17,g_str50"
            rsQuery = rsQuery + " FROM Shipments WHERE Status = " & SingleQuotes(strStatus)
            rsQuery = rsQuery + " AND g_str1274 <> '90' AND g_str1274 <> '92'"
            rsQuery = rsQuery + " AND (g_str50 <> " & SingleQuotes(g_str117) & " OR g_str16 = 'PR')"
            lblShipmentsView = "FedEx Express International"
        Case "Express IPD"
            'Build IPD Query
            rsQuery = "SELECT g_str29,g_str1123,g_str1,g_str25,g_str1355,IPDStatus,g_str11,"
            rsQuery = rsQuery + "g_str12,g_str13,g_str15,g_str16,g_str17,g_str50"
            rsQuery = rsQuery + " FROM IPD WHERE Status = " & SingleQuotes(strStatus)
            rsQuery = rsQuery + " AND MAWB <> 1"
            lblShipmentsView = "FedEx Express IPD"
        Case "Express TD"
            'Build Domestic Express Query
            rsQuery = "SELECT g_str29,g_str1123,g_str1,g_str25,g_str11,"
            rsQuery = rsQuery + "g_str12,g_str13,g_str15,g_str16,g_str17"
            rsQuery = rsQuery + " FROM TD WHERE Status = " & SingleQuotes(strStatus)
            rsQuery = rsQuery + " AND g_str1274 <> '90' AND g_str1274 <> '92'"
            ' rsQuery = rsQuery + " AND g_str50 = " & SingleQuotes(g_str117) & " AND g_str16 <> 'PR'"
            lblShipmentsView = "FedEx Express TD"
        Case "Ground/FHD Domestic"
            'Build Ground/FHD Domestic query
            rsQuery = "SELECT g_str29,g_str1,g_str25,g_str3056,g_str3057,g_str11,g_str12,"
            rsQuery = rsQuery + "g_str13,g_str15,g_str16,g_str17"
            rsQuery = rsQuery + " FROM Shipments WHERE Status = " & SingleQuotes(strStatus)
            rsQuery = rsQuery + " AND (g_str1274 = '90' OR g_str1274 = '92')"
            rsQuery = rsQuery + " AND g_str50 = " & SingleQuotes(g_str117) & ""
            lblShipmentsView = "FedEx Ground and Home Delivery Domestic"
        Case "Ground/FHD Int'l"
            'Build Ground/FHD Int'l query
            rsQuery = "SELECT g_str29,g_str1,g_str25,g_str3056,g_str3057,g_str11,g_str12,"
            rsQuery = rsQuery + "g_str13,g_str15,g_str16,g_str17,g_str50"
            rsQuery = rsQuery + " FROM Shipments WHERE Status = " & SingleQuotes(strStatus)
            rsQuery = rsQuery + " AND (g_str1274 = '90' OR g_str1274 = '92')"
            rsQuery = rsQuery + " AND g_str50 <> " & SingleQuotes(g_str117) & ""
            lblShipmentsView = "FedEx Ground and Home Delivery International"
        Case "Ground/FHD TD"
            'Build Ground/FHD Domestic query
            rsQuery = "SELECT g_str29,g_str1123,g_str1,g_str25,g_str11,"
            rsQuery = rsQuery + "g_str12,g_str13,g_str15,g_str16,g_str17"
            rsQuery = rsQuery + " FROM TD WHERE Status = " & SingleQuotes(strStatus)
            rsQuery = rsQuery + " AND (g_str1274 = '90' OR g_str1274 = '92')"
            ' rsQuery = rsQuery + " AND g_str50 = " & SingleQuotes(g_str117) & ""
            lblShipmentsView = "FedEx Ground/HD TD"
        Case "SmartPost"
            'Build SmartPost Query
            rsQuery = "SELECT g_str29,g_str1,g_strDCB,g_str25,g_str11,g_str12,"
            rsQuery = rsQuery + "g_str13,g_str15,g_str16,g_str17"
            rsQuery = rsQuery + " FROM SmartPost WHERE Status = " & SingleQuotes(strStatus)
            rsQuery = rsQuery + " AND g_str1274 = '99'"
            lblShipmentsView = "FedEx SmartPost"
        Case "SmartPost Plus"
            'Build SmartPost Plus Query
            rsQuery = "SELECT g_str29,g_str1,g_strDCB,g_str25,g_str11,g_str12,"
            rsQuery = rsQuery + "g_str13,g_str15,g_str16,g_str17,g_str11USPS,g_str17USPS"
            rsQuery = rsQuery + " FROM SmartPost WHERE Status = " & SingleQuotes(strStatus)
            rsQuery = rsQuery + " AND g_str1274 = '03'"
            lblShipmentsView = "FedEx SmartPost Plus"
        Case "Returns - Label"
            rsQuery = "SELECT g_str29,g_str1,g_str25,g_str3056,g_str3057,g_str2210,"
            rsQuery = rsQuery + "g_str11,g_str12,g_str13,g_str15,g_str16,g_str17"
            rsQuery = rsQuery + " FROM Returns WHERE Status = " & SingleQuotes(strStatus)
            rsQuery = rsQuery + " AND Type = 'Label'"
            lblShipmentsView = "Printed Return Labels"
        Case "Returns - Online"
            rsQuery = "SELECT g_str29,g_str1,g_str25,g_str3056,g_str3057,g_str2210,g_str2392,"
            rsQuery = rsQuery + "g_str11,g_str12,g_str13,g_str15,g_str16,g_str17"
            rsQuery = rsQuery + " FROM Returns WHERE Status = " & SingleQuotes(strStatus)
            rsQuery = rsQuery + " AND Type = 'Online'"
            lblShipmentsView = "Online Return Labels"
    End Select
    ' 2010-06-07, JFW, Blank all shipments
    If strAcctNum <> "" Then
        rsQuery = rsQuery + " AND g_str10 = " & SingleQuotes(strAcctNum)
    End If
    If chkAllDates = 0 And IsDate(txtShipDate) Then
        rsQuery = rsQuery + " AND g_str24 = " & SingleQuotes(Format(txtShipDate, "YYYYMMDD"))
    End If
    If strField <> "" Then
        rsQuery = rsQuery + " AND " & strField & " LIKE " & SingleQuotes("%" & strValue & "%")
    End If
    rsQuery = rsQuery + " ORDER BY " & strSortField & " " & strDirection
    
    'If history recordset open close it and reopen
    If m_rsHistory.State = adStateOpen Then m_rsHistory.Close
    m_rsHistory.Open rsQuery, g_connFSMSClient, adOpenStatic, adLockOptimistic
    grdShipments.Enabled = True
    
    With grdShipments
        Set .DataSource = m_rsHistory
        .Refresh
        
        'Set Column Headings for Service types
        Select Case strType
            Case "All TD", "Express TD", "Ground/FHD TD"
                'Set Express Domestic column headings
                .Columns(0).Caption = "Trk #"
                .Columns(0).Width = 1500
                .Columns(1).Caption = "Master Trk #"
                .Columns(1).Width = 1500
                .Columns(2).Caption = "Order ID"
                .Columns(3).Caption = "Reference"
                .Columns(4).Caption = "Company"
                .Columns(5).Caption = "Contact"
                .Columns(6).Caption = "Addr1"
                .Columns(7).Caption = "City"
                .Columns(8).Caption = "St"
                .Columns(8).Width = 300
                .Columns(9).Caption = "Zip"
                .Columns(9).Width = 600
            Case "Express Domestic", "ALL Domestic"
                'Set Express Domestic column headings
                .Columns(0).Caption = "Trk #"
                .Columns(0).Width = 1500
                .Columns(1).Caption = "Master Trk #"
                .Columns(1).Width = 1500
                .Columns(2).Caption = "Order ID"
                .Columns(3).Caption = "Reference"
                .Columns(4).Caption = "Company"
                .Columns(5).Caption = "Contact"
                .Columns(6).Caption = "Addr1"
                .Columns(7).Caption = "City"
                .Columns(8).Caption = "St"
                .Columns(8).Width = 300
                .Columns(9).Caption = "Zip"
                .Columns(9).Width = 600
            Case "Express Int'l", "ALL", "ALL Int'l"
                'Set Express Int'l column headings
                .Columns(0).Caption = "Trk #"
                .Columns(0).Width = 1500
                .Columns(1).Caption = "Master Trk #"
                .Columns(1).Width = 1500
                .Columns(2).Caption = "Order ID"
                .Columns(3).Caption = "Reference"
                .Columns(4).Caption = "Company"
                .Columns(5).Caption = "Contact"
                .Columns(6).Caption = "Addr1"
                .Columns(7).Caption = "City"
                .Columns(8).Caption = "St"
                .Columns(8).Width = 300
                .Columns(9).Caption = "Zip"
                .Columns(9).Width = 600
                .Columns(10).Caption = "Country"
            Case "Express IPD"
                'Set Express IPD column headings
                .Columns(0).Caption = "Trk #"
                .Columns(0).Width = 1500
                .Columns(1).Caption = "Master Trk #"
                .Columns(1).Width = 1500
                .Columns(2).Caption = "Order ID"
                .Columns(3).Caption = "Reference"
                .Columns(4).Caption = "IOR Facility"
                .Columns(5).Caption = "IPD Status"
                .Columns(6).Caption = "Company"
                .Columns(7).Caption = "Contact"
                .Columns(8).Caption = "Addr1"
                .Columns(9).Caption = "City"
                .Columns(10).Caption = "St"
                .Columns(10).Width = 300
                .Columns(11).Caption = "Zip"
                .Columns(11).Width = 600
                .Columns(12).Caption = "Country"
            Case "Ground/FHD Domestic"
                'Set Ground/FHD Domestic column headings
                .Columns(0).Caption = "Trk #"
                .Columns(1).Caption = "Order ID"
                .Columns(2).Caption = "Reference"
                .Columns(3).Caption = "PO #"
                .Columns(4).Caption = "Inv #"
                .Columns(5).Caption = "Company"
                .Columns(6).Caption = "Contact"
                .Columns(7).Caption = "Addr1"
                .Columns(8).Caption = "City"
                .Columns(9).Caption = "St"
                .Columns(9).Width = 300
                .Columns(10).Caption = "Zip"
                .Columns(10).Width = 600
            Case "Ground/FHD Int'l"
                'Set Ground/FHD Int'l column headings
                .Columns(0).Caption = "Trk #"
                .Columns(1).Caption = "Order ID"
                .Columns(2).Caption = "Reference"
                .Columns(3).Caption = "PO #"
                .Columns(4).Caption = "Inv #"
                .Columns(5).Caption = "Company"
                .Columns(6).Caption = "Contact"
                .Columns(7).Caption = "Addr1"
                .Columns(8).Caption = "City"
                .Columns(9).Caption = "St"
                .Columns(9).Width = 300
                .Columns(10).Caption = "Zip"
                .Columns(10).Width = 600
                .Columns(11).Caption = "Country"
            Case "SmartPost"
                'Set SmartPost column headings
                .Columns(0).Caption = "Trk #"
                .Columns(0).Width = 2000
                .Columns(1).Caption = "Order ID"
                .Columns(2).Caption = "Delivery Confirm #"
                .Columns(2).Width = 2800
                .Columns(3).Caption = "Reference"
                .Columns(4).Caption = "Company"
                .Columns(5).Caption = "Contact"
                .Columns(6).Caption = "Addr1"
                .Columns(7).Caption = "City"
                .Columns(8).Caption = "St"
                .Columns(8).Width = 300
                .Columns(9).Caption = "Zip"
                .Columns(9).Width = 600
            Case "SmartPost Plus"
                'Set SmartPost Plus column headings
                .Columns(0).Caption = "Trk #"
                .Columns(0).Width = 1500
                .Columns(1).Caption = "Order ID"
                .Columns(2).Caption = "Delivery Confirm #"
                .Columns(2).Width = 2800
                .Columns(3).Caption = "Reference"
                .Columns(4).Caption = "Company"
                .Columns(5).Caption = "Contact"
                .Columns(6).Caption = "Addr1"
                .Columns(7).Caption = "City"
                .Columns(8).Caption = "St"
                .Columns(8).Width = 300
                .Columns(9).Caption = "Zip"
                .Columns(9).Width = 600
                .Columns(10).Caption = "USPS Location"
                .Columns(11).Caption = "USPS Zip"
                .Columns(11).Width = 600
            Case "Returns - Label"
                'Set Ground/FHD Int'l column headings
                .Columns(0).Caption = "Trk #"
                .Columns(1).Caption = "Order ID"
                .Columns(2).Caption = "Reference"
                .Columns(3).Caption = "PO #"
                .Columns(4).Caption = "Inv #"
                .Columns(5).Caption = "RMA #"
                .Columns(6).Caption = "Company"
                .Columns(7).Caption = "Contact"
                .Columns(8).Caption = "Addr1"
                .Columns(9).Caption = "City"
                .Columns(10).Caption = "St"
                .Columns(10).Width = 300
                .Columns(11).Caption = "Zip"
                .Columns(11).Width = 600
            Case "Returns - Online"
                'Set Ground/FHD Int'l column headings
                .Columns(0).Caption = "Trk #"
                .Columns(1).Caption = "Order ID"
                .Columns(2).Caption = "Reference"
                .Columns(3).Caption = "PO #"
                .Columns(4).Caption = "Inv #"
                .Columns(5).Caption = "RMA #"
                .Columns(6).Caption = "Email"
                .Columns(7).Caption = "Company"
                .Columns(8).Caption = "Contact"
                .Columns(9).Caption = "Addr1"
                .Columns(10).Caption = "City"
                .Columns(11).Caption = "St"
                .Columns(11).Width = 300
                .Columns(12).Caption = "Zip"
                .Columns(12).Width = 600
        End Select
        grdShipments.Caption = strHeading & Str(m_rsHistory.RecordCount)
    
        '07/12/06 If the grid is empty disable grid.
        If m_rsHistory.RecordCount = 0 Then
            .Enabled = False
        End If
    End With
    
Release:
    If rsAcctNum.State = adStateOpen Then rsAcctNum.Close
    Set rsAcctNum = Nothing
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:UpdateShipmentsGrid"
    Resume Release
    Resume
End Sub
'---------------------------------------------------------------------------------------
' Module    : GridCaptionToFieldName
' DateTime  : 6/21/2004
' Author    : Chris Elwell
' Purpose   : Converts Shipping History grid captions to database field names.
' Call from :
'---------------------------------------------------------------------------------------
'
Private Function GridCaptionToFieldName(ByVal strField As String) As String
    Select Case Trim(strField)
        Case "IOR Facility"
            GridCaptionToFieldName = "g_str1355"
        Case "Trk #"
            GridCaptionToFieldName = "g_str29"
        Case "Master Trk #"
            GridCaptionToFieldName = "g_str1123"
        Case "Order ID"
            GridCaptionToFieldName = "g_str1"
        Case "IPD Status"
            GridCaptionToFieldName = "IPDStatus"
        Case "Reference"
            GridCaptionToFieldName = "g_str25"
        Case "PO #"
            GridCaptionToFieldName = "g_str3056"
        Case "Inv #"
            GridCaptionToFieldName = "g_str3057"
        Case "Company"
            GridCaptionToFieldName = "g_str11"
        Case "Contact"
            GridCaptionToFieldName = "g_str12"
        '20070711-01 Added space to actual caption name
        Case "Addr 1"
            GridCaptionToFieldName = "g_str13"
        Case "City"
            GridCaptionToFieldName = "g_str15"
        Case "State"
            GridCaptionToFieldName = "g_str16"
        Case "Zip"
            GridCaptionToFieldName = "g_str17"
        Case "Country"
            GridCaptionToFieldName = "g_str50"
        Case "USPS Location"
            GridCaptionToFieldName = "g_str11USPS"
        Case "USPS Zip"
            GridCaptionToFieldName = "g_str17USPS"
        Case "Delivery Confirm #"
            GridCaptionToFieldName = "g_strDCB"
    End Select
End Function
'---------------------------------------------------------------------------------------
' Module    : TrackIt
' DateTime  : 4/21/2004
' Updated   : 8/17/2005 - Updated URL for tracking.
' Author    : Chris Elwell
' Purpose   : Tracks the passed tracking number
' Call from : TrackButton
'---------------------------------------------------------------------------------------
'
Private Sub TrackIt(ByVal strTrackNum As String)
    SSTab1.Tab = 4
    WebBrowser1.Navigate "http://www.fedex.com/Tracking?cntry_code=" & g_str117 & "&language=english&tracknumbers=" & strTrackNum
    StatusBar1.Panels(2) = "Tracking, please wait..."
End Sub
'---------------------------------------------------------------------------------------
' Module    : TrackItRef
' DateTime  : 4/21/2004
' Updated   : 8/17/2005 - Updated URL for tracking. Removed strRefType
' Author    : Chris Elwell
' Purpose   : Tracks by ref
' Call from : TrackButton
'---------------------------------------------------------------------------------------
'
Public Sub TrackItRef(ByVal strRef As String, ByVal strAcctNum As String)
    Dim strURL As String
    SSTab1.Tab = 4
    WebBrowser1.Navigate "https://www.fedex.com/AltRefTracking?account_number=" & strAcctNum & "&tracknumbers=" & strRef
    StatusBar1.Panels(2) = "Tracking, please wait..."
End Sub
'---------------------------------------------------------------------------------------
' Module    : SaveShipment
' DateTime  : 3/17/2004
' Author    : Chris Elwell
' Purpose   : Store shipment fields to database
' Call from : g_clsParser_ParseComplete()
'---------------------------------------------------------------------------------------
'
Public Sub SaveShipment(ByVal strTrkNum As String, ByVal Index As Integer)
    
    On Error GoTo EH
    
    '20070509-01 Exit Sub if Trk# is empty
    If strTrkNum = "" Then Exit Sub
    
    Dim strInsertQuery As String
    Dim str25 As String
    Dim str3056 As String
    Dim str3057 As String
    Dim rsRefs As New ADODB.Recordset
    Dim strQuery As String
    Dim i As Integer
    
    If IsDate(g_str24) Then g_str24 = Format(g_str24, "YYYYMMDD")
    
    strQuery = "SELECT g_str25, g_str3056, g_str3057 FROM MPS WHERE f1 = '" & g_str1 & "'"
    strQuery = strQuery & " AND Workstation = '" & g_strComputerName & "'"
    strQuery = strQuery & " order by ShipDate"
    
    rsRefs.Open strQuery, g_connFSMSClient, adOpenStatic, adLockBatchOptimistic
    
    If rsRefs.EOF Then
        str25 = g_str25
        str3056 = g_str3056
        str3057 = g_str3057
    Else
        For i = 1 To Index - 1
            rsRefs.MoveNext
        Next
        str25 = rsRefs!g_str25
        str3056 = rsRefs!g_str3056
        str3057 = rsRefs!g_str3057
    End If
    
    'debugprint "SaveShipment", g_blnTDChild
    
    If g_str1 = "TD MAWB CREATE" Then
        ' 2006-12-18, JFW, Child shipment IRS number
        strInsertQuery = "INSERT INTO TD ( OpenShipIndex, TDStatus, MAWB, " _
            & "g_str29, g_str1, g_str1123, g_str25, g_str50, g_str10, g_str24, " _
            & "g_str3056, g_str3057, g_str11, g_str12, g_str13, g_str15, g_str16, g_str17, " _
            & "g_str1274, g_str116, f1358, " _
            & "Status, ProcessTime, LocationName, [Transaction] ) "
            
'        If GetClientDatabaseType <> "Access" Then
'            strInsertQuery = Replace(strInsertQuery, "Transaction", """Transaction""")
'        End If

        strInsertQuery = strInsertQuery + " VALUES ( "
        If g_str542 <> "" Then
            strInsertQuery = strInsertQuery + SingleQuotes(g_str542) + ","
        ElseIf g_strTDOpenShip <> "" Then
            strInsertQuery = strInsertQuery + SingleQuotes(g_strTDOpenShip) + ","
        End If
        strInsertQuery = strInsertQuery + SingleQuotes("Open") + ","
        strInsertQuery = strInsertQuery + "1,"
        strInsertQuery = strInsertQuery + SingleQuotes(strTrkNum) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_str1) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_strTDMasterTrkNbr) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(str25) + ","
        If g_str50 <> "" Then
            strInsertQuery = strInsertQuery + SingleQuotes(g_frmTDAdd.tdIOR("f50")) + ","
        Else
            strInsertQuery = strInsertQuery + SingleQuotes("US") + ","
        End If
        strInsertQuery = strInsertQuery + SingleQuotes(g_str10) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Format(g_dteTDDate, "YYYYMMDD")) + ","
        
        strInsertQuery = strInsertQuery + SingleQuotes(str3056) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(str3057) + ","
        
        strInsertQuery = strInsertQuery + SingleQuotes(g_frmTDAdd.tdIOR("f11")) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_frmTDAdd.tdIOR("f12")) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_frmTDAdd.tdIOR("f13")) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_frmTDAdd.tdIOR("f15")) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_frmTDAdd.tdIOR("f16")) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_frmTDAdd.tdIOR("f17")) + ","
        
        strInsertQuery = strInsertQuery + SingleQuotes(g_str1274) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(0) + ","
        
        ' 2006-12-18, JFW, Child shipment IRS number
        strInsertQuery = strInsertQuery + SingleQuotes(g_str118) + ","
        
        strInsertQuery = strInsertQuery + "'Shipped',"
        
        If GetClientDatabaseType = "Access" Then
            strInsertQuery = strInsertQuery + "#" + CStr(Now) + "#, "
        Else
            strInsertQuery = strInsertQuery + "'" + CStr(Now) + "', "
        End If
    
        strInsertQuery = strInsertQuery + SingleQuotes(cboLocationName(0)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_strRepeatTrans, 512)) + ")"
        
    ElseIf g_blnTDChild Then
        ' 2006-12-18, JFW, Child shipment IRS number
        strInsertQuery = "INSERT INTO TD ( OpenShipIndex, TDStatus, MAWB, " _
            & "g_str29, g_str1, g_str1123, g_str25, g_str50, g_str10, g_str24, " _
            & "g_str3056, g_str3057, g_str11, g_str12, g_str13, g_str15, g_str16, g_str17, " _
            & "g_str1274, g_str116, f1358, " _
            & "Status, ProcessTime, LocationName, [Transaction] ) "
        
'        If GetClientDatabaseType <> "Access" Then
'            strInsertQuery = Replace(strInsertQuery, "Transaction", """Transaction""")
'        End If
        
        strInsertQuery = strInsertQuery + " VALUES ( "
        If g_str542 <> "" Then
            strInsertQuery = strInsertQuery + SingleQuotes(g_str542) + ","
        ElseIf g_strTDOpenShip <> "" Then
            strInsertQuery = strInsertQuery + SingleQuotes(g_strTDOpenShip) + ","
        End If
        strInsertQuery = strInsertQuery + SingleQuotes("Open") + ","
        strInsertQuery = strInsertQuery + "0,"
        strInsertQuery = strInsertQuery + SingleQuotes(strTrkNum) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_str1) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_strTDMasterTrkNbr) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(str25) + ","
        If g_str50 <> "" Then
            strInsertQuery = strInsertQuery + SingleQuotes(g_str50) + ","
        Else
            strInsertQuery = strInsertQuery + SingleQuotes("US") + ","
        End If
        strInsertQuery = strInsertQuery + SingleQuotes(g_str10) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Format(g_dteTDDate, "YYYYMMDD")) + ","
        
        strInsertQuery = strInsertQuery + SingleQuotes(str3056) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(str3057) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str11, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str12, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str13, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str15, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str16, 14)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str17, 10)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_str1274) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_str116) + ","
        
        ' 2006-12-18, JFW, Child shipment IRS number
        strInsertQuery = strInsertQuery + SingleQuotes(g_str118) + ","
        
        strInsertQuery = strInsertQuery + "'Shipped',"
        
        If GetClientDatabaseType = "Access" Then
            strInsertQuery = strInsertQuery + "#" + CStr(Now) + "#, "
        Else
            strInsertQuery = strInsertQuery + "'" + CStr(Now) + "', "
        End If
    
        strInsertQuery = strInsertQuery + SingleQuotes(cboLocationName(0)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_strRepeatTrans, 512)) + ")"
        
    Else
        strInsertQuery = "INSERT INTO Shipments "
        strInsertQuery = strInsertQuery + "( g_str29, g_str1, g_str1123, g_str25, g_str3056, g_str3057, g_str11, g_str12, g_str13, g_str15, g_str16, g_str17, g_str50, g_str10, g_str1274, g_str24, g_str116, Status, ProcessTime, LocationName, [Transaction] ) "
        
'        If GetClientDatabaseType <> "Access" Then
'            strInsertQuery = Replace(strInsertQuery, "Transaction", """Transaction""")
'        End If

        strInsertQuery = strInsertQuery + "VALUES ( "
        strInsertQuery = strInsertQuery + SingleQuotes(strTrkNum) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_str1) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_str1123) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(str25) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(str3056) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(str3057) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str11, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str12, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str13, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str15, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str16, 14)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str17, 10)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_str50) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_str10) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_str1274) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_str24) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(g_str116) + ","
        strInsertQuery = strInsertQuery + "'Shipped',"
        
        If GetClientDatabaseType = "Access" Then
            strInsertQuery = strInsertQuery + "#" + CStr(Now) + "#, "
        Else
            strInsertQuery = strInsertQuery + "'" + CStr(Now) + "', "
        End If
    
        strInsertQuery = strInsertQuery + SingleQuotes(cboLocationName(0)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_strRepeatTrans, 512)) + ")"
    
    End If
        
'    strInsertQuery = "INSERT INTO Shipments VALUES("
'    strInsertQuery = strInsertQuery + SingleQuotes(strTrkNum) + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(g_str1) + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(g_str1123) + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(str25) + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(str3056) + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(str3057) + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(left(g_str11,35)) + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(left(g_str12,35)) + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(left(g_str13,35)) + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(left(g_str15,35)) + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(left(g_str16,14)) + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(left(g_str17,10)) + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(g_str50) + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(g_str10) + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(g_str1274) + ","
'    If IsDate(g_str24) Then g_str24 = Format(g_str24, "YYYYMMDD")
'    If g_str24 = "" Then g_str24 = Format(Date, "YYYYMMDD")
'    strInsertQuery = strInsertQuery + SingleQuotes(g_str24) + ","
'    strInsertQuery = strInsertQuery + "'Shipped',"
'    strInsertQuery = strInsertQuery + "#" + CStr(Now) + "#" + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(cboLocationName(0)) + ","
'    strInsertQuery = strInsertQuery + SingleQuotes(left(g_strRepeatTrans,512)) + ")"
    
    ' debugprintstrInsertQuery
    ' debugprint "SaveShipment, " & strInsertQuery
    
    ' MsgBox strInsertQuery, vbApplicationModal
    
    DebugPrint "FSMSClient, GBMicro, frmShip, SaveShipment, insert query (" & strInsertQuery & ")"

    DebugPrint strInsertQuery
    
    g_connFSMSClient.Execute strInsertQuery

Release:
    If rsRefs.State = adStateOpen Then rsRefs.Close
    Set rsRefs = Nothing
    Exit Sub
EH:
    DebugPrint "FSMSClient, GBMicro, frmShip, SaveShipment, error, " & Err.Description & "."
    MsgBox Err.Description, vbCritical, "frmShip:SaveShipment"
    Resume Release
    Resume
    
End Sub
'---------------------------------------------------------------------------------------
' Module    : SaveIPDShipment
' DateTime  : 3/17/2004
' Author    : Chris Elwell
' Purpose   : Store IPD shipment fields to database
' Call from : g_clsParser_ParseComplete()
'---------------------------------------------------------------------------------------
'
Private Sub SaveIPDShipment(ByVal strTrkNum As String, ByVal blnIsCreate As Boolean, Optional ByVal strMasterTrkNum As String)
    Dim strInsertQuery As String
    Dim rsf1297 As New ADODB.Recordset
    Dim strQuery As String
    
    On Error GoTo EH
    
    If g_str1355 = "" Then
        Debug.Assert False
        Err.Raise 12345, "SaveIPDShipment", "IPD IOR not set."
    End If
        
    If Not blnIsCreate Then
        strQuery = "SELECT g_str1297 FROM IPD WHERE IPDStatus = 'Open' And g_str1355 = " & SingleQuotes(g_str1355)
        rsf1297.Open strQuery, g_connFSMSClient, adOpenStatic, adLockOptimistic
        
        If Not rsf1297.BOF And Not rsf1297.EOF Then
            g_str1297 = rsf1297!g_str1297
        End If
    End If
    
    If IsDate(g_str24) Then g_str24 = Format(g_str24, "YYYYMMDD")
    If g_str24 = "" Then g_str24 = Format(Date, "YYYYMMDD")
    strInsertQuery = "INSERT INTO IPD ("
    strInsertQuery = strInsertQuery + "[g_str1297], "
    strInsertQuery = strInsertQuery + "[g_str1355], "
    strInsertQuery = strInsertQuery + "[g_str1358], "
    strInsertQuery = strInsertQuery + "[IPDStatus], "
    strInsertQuery = strInsertQuery + "[MAWB], "
    strInsertQuery = strInsertQuery + "[g_str29], "
    strInsertQuery = strInsertQuery + "[g_str1123], "
    strInsertQuery = strInsertQuery + "[g_str1], "
    strInsertQuery = strInsertQuery + "[g_str25], "
    strInsertQuery = strInsertQuery + "[g_str11], "
    strInsertQuery = strInsertQuery + "[g_str12], "
    strInsertQuery = strInsertQuery + "[g_str13], "
    strInsertQuery = strInsertQuery + "[g_str15], "
    strInsertQuery = strInsertQuery + "[g_str16], "
    strInsertQuery = strInsertQuery + "[g_str17], "
    strInsertQuery = strInsertQuery + "[g_str50], "
    strInsertQuery = strInsertQuery + "[g_str10], "
    strInsertQuery = strInsertQuery + "[g_str24], "
    strInsertQuery = strInsertQuery + "[Status], "
    strInsertQuery = strInsertQuery + "[ProcessTime], "
    strInsertQuery = strInsertQuery + "[LocationName], "
    strInsertQuery = strInsertQuery + "[Transaction] ) "
    strInsertQuery = strInsertQuery + " VALUES ( "
    strInsertQuery = strInsertQuery + SingleQuotes(g_str1297) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str1355) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str1358) + ","
    strInsertQuery = strInsertQuery + SingleQuotes("Open") + ","
    'If it's a MAWB Create, set MAWB to 1
    If blnIsCreate Then
        strInsertQuery = strInsertQuery + "1,"
        strInsertQuery = strInsertQuery + SingleQuotes(strTrkNum) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(strTrkNum) + ","
    Else
        strInsertQuery = strInsertQuery + "0,"
        strInsertQuery = strInsertQuery + SingleQuotes(strTrkNum) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(strMasterTrkNum) + ","
    End If
    strInsertQuery = strInsertQuery + SingleQuotes(g_str1) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str25) + ","
    If blnIsCreate Then
        strInsertQuery = strInsertQuery + SingleQuotes(Left(frmSetup.f1486, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(frmSetup.f1485, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(frmSetup.f1487, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(frmSetup.f1489, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(frmSetup.f1490, 14)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(frmSetup.f1491, 10)) + ","
    Else
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str11, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str12, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str13, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str15, 35)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str16, 14)) + ","
        strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str17, 10)) + ","
    End If
    strInsertQuery = strInsertQuery + SingleQuotes(g_str50) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str10) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str24) + ","
    strInsertQuery = strInsertQuery + "'Shipped',"
    
    If GetClientDatabaseType = "Access" Then
        strInsertQuery = strInsertQuery + "#" + CStr(Now) + "#)"
    Else
        strInsertQuery = strInsertQuery + "'" + CStr(Now) + "', "
    End If
    
    strInsertQuery = strInsertQuery + SingleQuotes(frmShip.cboLocationName(0)) + ", "
    strInsertQuery = strInsertQuery + SingleQuotes(Left(g_strRepeatTrans, 512)) + ")"
    
    DebugPrint "FSMSClient, SaveIPDShipment, SQL (" & strInsertQuery & ")"
        
    g_connFSMSClient.Execute strInsertQuery
        
Release:
    If rsf1297.State = adStateOpen Then rsf1297.Close
    Set rsf1297 = Nothing
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:SaveIPDShipment"
    Resume Release
    Resume
    
End Sub
'---------------------------------------------------------------------------------------
' Module    : ChangeStatusToDelete
' DateTime  : 3/17/2004
' Modified  : 3/14/2005 - Added Smart Post and MPS deletes
' Author    : Chris Elwell
' Purpose   : Changes a package status to Deleted in the Shipments table.
' Call from : g_clsParser_ParseComplete()
'---------------------------------------------------------------------------------------
'
Private Sub ChangeStatusToDelete(ByVal strTrkNum As String)
    Dim rsQuery As String
    Dim rsMPS As New ADODB.Recordset
    Dim strMPS As String
    
    On Error GoTo EH
    
    'Update SmartPost table
    If g_str1274 = "99" = 1 Then
        rsQuery = "UPDATE SmartPost SET [Status] = 'Deleted' WHERE g_str29 = " & SingleQuotes(strTrkNum)
    'Update Shipments table, check for MPS and update all for that Master trk#
    Else
        strMPS = "SELECT g_str1123 FROM Shipments WHERE g_str29 = " & SingleQuotes(strTrkNum)
        rsMPS.Open strMPS, g_connFSMSClient, adOpenStatic, adLockBatchOptimistic
        If rsMPS.BOF Then
            rsQuery = "UPDATE Shipments SET [Status] = 'Deleted' WHERE g_str29 = " & SingleQuotes(strTrkNum)
        Else
            If Trim(rsMPS!g_str1123 & "") = "" Then
                rsQuery = "UPDATE Shipments SET [Status] = 'Deleted' WHERE g_str29 = " & SingleQuotes(strTrkNum)
            Else
                rsQuery = "UPDATE Shipments SET [Status] = 'Deleted' WHERE g_str1123 = " & SingleQuotes(rsMPS!g_str1123)
            End If
        End If
    End If

    g_connFSMSClient.Execute rsQuery
    
    rsQuery = "UPDATE TD SET [Status] = 'Deleted' WHERE g_str29 = " & SingleQuotes(strTrkNum)
    g_connFSMSClient.Execute rsQuery
    
    'This one second delay allows update to complete before query is re-run.
    If g_blnDeletesComplete Then
        Call Pause(MULTIPLE_DELETE_DELAY)
    End If

Release:
    If rsMPS.State = adStateOpen Then rsMPS.Close
    Set rsMPS = Nothing
    
    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:ChangeStatusToDelete"
     Resume Release
     
End Sub
'---------------------------------------------------------------------------------------
' Module    : ChangeReturnStatusToDelete
' DateTime  : 6/30/2005
' Author    : Chris Elwell
' Purpose   : Changes a return package status to Deleted in the Returns table.
' Call from : g_clsParser_ParseComplete()
'---------------------------------------------------------------------------------------
'
Private Sub ChangeReturnStatusToDelete(ByVal strTrkNum As String)
    
    On Error GoTo EH
    
    Dim rsQuery As String
    
    'Update Returns table
    rsQuery = "UPDATE Returns SET [Status] = 'Deleted' WHERE g_str29 = " & SingleQuotes(strTrkNum)
    g_connFSMSClient.Execute rsQuery
    
    'This one second delay allows update to complete before query is re-run.
    If g_blnDeletesComplete Then
        Call Pause(MULTIPLE_DELETE_DELAY)
    End If

    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:ChangeReturnStatusToDelete"
     
End Sub
'---------------------------------------------------------------------------------------
' Module    : ChangeIPDStatus
' DateTime  : 10/28/2004
' Author    : Chris Elwell
' Purpose   : Changes a IPD status to Confirmed or Deleted in the IPD table.
' Call from : g_clsParser_ParseComplete()
'---------------------------------------------------------------------------------------
'
Private Sub ChangeIPDStatus(ByVal strTrkNum As String, ByVal strStatus As String)
    Dim strQuery As String
    Dim Start As Long
    Dim rsTrkNum As New ADODB.Recordset
    
    On Error GoTo EH
    
    strQuery = "UPDATE IPD SET [IPDStatus] = " & SingleQuotes(strStatus)
    If strStatus = "Deleted" Then
        strQuery = strQuery & ", [Status] = " & SingleQuotes("Deleted")
    End If
    strQuery = strQuery & " WHERE g_str1123 = " & SingleQuotes(strTrkNum)

    g_connFSMSClient.Execute strQuery
    
    'This one second delay allows update to complete before query is re-run.
    If g_blnDeletesComplete Then
        Call Pause(MULTIPLE_DELETE_DELAY)
    End If
    
    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:ChangeIPDStatus"
End Sub
'---------------------------------------------------------------------------------------
' Module    : ChangeCRNStatus
' DateTime  : 10/28/2004
' Author    : Chris Elwell
' Purpose   : Changes a CRN status to Deleted in the IPD table.
' Call from : g_clsParser_ParseComplete()
'---------------------------------------------------------------------------------------
'
Private Sub ChangeCRNStatus(ByVal strTrkNum As String)
    Dim rsQuery As String
    Dim Start As Long
    
    On Error GoTo EH
    
    rsQuery = "UPDATE IPD SET [Status] = 'Deleted' WHERE g_str29 = " & SingleQuotes(strTrkNum)

    g_connFSMSClient.Execute rsQuery
    
    'This one second delay allows update to complete before query is re-run.
    If g_blnDeletesComplete Then
        Call Pause(MULTIPLE_DELETE_DELAY)
    End If
    
    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:ChangeCRNStatus"
End Sub
'---------------------------------------------------------------------------------------
' Module    : SetLogo
' DateTime  : 2/7/2006
' Author    : Chris Elwell
' Purpose   : Sets FedEx logo based on Express, Ground, SmartPost, Freight
' Call from : f1274_Change, f1274_Click
'---------------------------------------------------------------------------------------
'
Public Sub SetLogo()
    If Left(f1274, 2) = "92" Or Left(f1274, 2) = "90" Then
        imgLogo1.Visible = False
        imgLogo2.Visible = True
        imgLogo3.Visible = False
        imgLogo4.Visible = False
    ElseIf Left(f1274, 2) = "99" Then
        imgLogo1.Visible = False
        imgLogo2.Visible = False
        imgLogo3.Visible = True
        imgLogo4.Visible = False
    ElseIf Left(f1274, 3) = "111" Then
        imgLogo1.Visible = False
        imgLogo2.Visible = False
        imgLogo3.Visible = False
        imgLogo4.Visible = True
    Else
        imgLogo1.Visible = True
        imgLogo2.Visible = False
        imgLogo3.Visible = False
        imgLogo4.Visible = False
    End If
End Sub
'---------------------------------------------------------------------------------------
' Module    : SetTrackButtons
' DateTime  : 5/24/2004
' Modifed   : 8/19/2004
' Change    : If fedex.com is disabled then disable trk buttons.
' Author    : Chris Elwell
' Purpose   : Enable/disable Track button on Shipping History
' Call from : grdShipments_Click, optType_Click, SSTab1_Click, g_clsParser_ParseComplete
'---------------------------------------------------------------------------------------
'
Public Sub SetTrackButtons()
    On Error GoTo EH
    
    'If Tracking button are disabled in setup or nothing is selected in the grid
    'disable buttons - 8/19 if fedex.com tab disabled, disable tracking buttons
    If grdShipments.SelBookmarks.Count <= 0 Or SSTab1.TabVisible(4) = False Or cboShipmentStatus = "Deleted" Then
        Call SetMenuButton(3, False)
        Call SetMenuButton(4, False)
        Call SetMenuButton(7, False)
    Else
        Call SetMenuButton(3, True)
        Call SetMenuButton(7, True)
        'If all Ground ref fields are empty, disable Track by Ref button
        If Left(cboShipmentType, 10) = "Ground/FHD" Then
            If grdShipments.Columns("Reference") <> "" Then
                Call SetMenuButton(4, True)
            ElseIf grdShipments.Columns("Reference") = "" And grdShipments.Columns("PO #") = "" And grdShipments.Columns("Inv #") = "" Then
                Call SetMenuButton(4, False)
            Else
                Call SetMenuButton(4, True)
            End If
        'All other Shipment Types except SmartPost Plus can trk by ref
        ElseIf cboShipmentType <> "SmartPost Plus" Then
            If grdShipments.Columns("Reference") = "" Then
                Call SetMenuButton(4, False)
            Else
                Call SetMenuButton(4, True)
            End If
        End If
    End If
        
EH:
    'Do nothing
End Sub
'---------------------------------------------------------------------------------------
' Module    : LoadSearchFields
' DateTime  : 6/11/2004
' Modified  : 10/22/2004 Added IPD search fields
' Author    : Chris Elwell
' Purpose   : Load Search Field into combo on Shipping History tab.
' Call from :
'---------------------------------------------------------------------------------------
'
Private Sub LoadSearchFields(ByVal strType As String)
    
    On Error GoTo EH
    
    cboSearchField.Clear
        
    Select Case strType
        'Express Domestic
        Case "Express Domestic", "ALL Domestic", "All TD", "Express TD"
            cboSearchField.AddItem "Trk #"
            cboSearchField.AddItem "Master Trk #"
            cboSearchField.AddItem "Order ID"
            cboSearchField.AddItem "Reference"
            cboSearchField.AddItem "Company"
            cboSearchField.AddItem "Contact"
            cboSearchField.AddItem "Addr 1"
            cboSearchField.AddItem "City"
            cboSearchField.AddItem "State"
            cboSearchField.AddItem "Zip"
        'Express Int'l
        Case "Express Int'l", "ALL", "ALL Int'l"
            cboSearchField.AddItem "Trk #"
            cboSearchField.AddItem "Master Trk #"
            cboSearchField.AddItem "Order ID"
            cboSearchField.AddItem "Reference"
            cboSearchField.AddItem "Company"
            cboSearchField.AddItem "Contact"
            cboSearchField.AddItem "Addr 1"
            cboSearchField.AddItem "City"
            cboSearchField.AddItem "State"
            cboSearchField.AddItem "Zip"
            cboSearchField.AddItem "Country"
        'IPD
        Case "Express IPD"
            cboSearchField.AddItem "Trk #"
            cboSearchField.AddItem "Master Trk #"
            cboSearchField.AddItem "Order ID"
            cboSearchField.AddItem "IOR Facility"
            cboSearchField.AddItem "IPD Status  "
            cboSearchField.AddItem "Reference"
            cboSearchField.AddItem "Company"
            cboSearchField.AddItem "Contact"
            cboSearchField.AddItem "Addr 1"
            cboSearchField.AddItem "City"
            cboSearchField.AddItem "State"
            cboSearchField.AddItem "Zip"
            cboSearchField.AddItem "Country"
        'Ground Domestic
        Case "Ground/FHD Domestic", "Ground/FHD TD"
            cboSearchField.AddItem "Trk #"
            cboSearchField.AddItem "Order ID"
            cboSearchField.AddItem "Reference"
            cboSearchField.AddItem "PO #"
            cboSearchField.AddItem "Inv #"
            cboSearchField.AddItem "Company"
            cboSearchField.AddItem "Contact"
            cboSearchField.AddItem "Addr 1"
            cboSearchField.AddItem "City"
            cboSearchField.AddItem "State"
            cboSearchField.AddItem "Zip"
        'Ground Int'l
        Case "Ground/FHD Int'l"
            cboSearchField.AddItem "Trk #"
            cboSearchField.AddItem "Order ID"
            cboSearchField.AddItem "Reference"
            cboSearchField.AddItem "PO #"
            cboSearchField.AddItem "Inv #"
            cboSearchField.AddItem "Company"
            cboSearchField.AddItem "Contact"
            cboSearchField.AddItem "Addr 1"
            cboSearchField.AddItem "City"
            cboSearchField.AddItem "State"
            cboSearchField.AddItem "Zip"
            cboSearchField.AddItem "Country"
        'SmartPost
        Case "SmartPost"
            cboSearchField.AddItem "Trk #"
            cboSearchField.AddItem "Delivery Confirm #"
            cboSearchField.AddItem "Order ID"
            cboSearchField.AddItem "Reference"
            cboSearchField.AddItem "Company"
            cboSearchField.AddItem "Contact"
            cboSearchField.AddItem "Addr 1"
            cboSearchField.AddItem "City"
            cboSearchField.AddItem "State"
            cboSearchField.AddItem "Zip"
            cboSearchField.AddItem "Country"
            cboSearchField.AddItem "USPS Location"
            cboSearchField.AddItem "USPS Zip"
        'Return labels
        Case "Returns - Label"
            cboSearchField.AddItem "Trk #"
            cboSearchField.AddItem "Order ID"
            cboSearchField.AddItem "Reference"
            cboSearchField.AddItem "PO #"
            cboSearchField.AddItem "Inv #"
            cboSearchField.AddItem "RMA #"
            cboSearchField.AddItem "Company"
            cboSearchField.AddItem "Contact"
            cboSearchField.AddItem "Addr 1"
            cboSearchField.AddItem "City"
            cboSearchField.AddItem "State"
            cboSearchField.AddItem "Zip"
        'Online return labels
        Case "Returns - Online"
            cboSearchField.AddItem "Trk #"
            cboSearchField.AddItem "Order ID"
            cboSearchField.AddItem "Reference"
            cboSearchField.AddItem "PO #"
            cboSearchField.AddItem "Inv #"
            cboSearchField.AddItem "RMA #"
            cboSearchField.AddItem "Email"
            cboSearchField.AddItem "Company"
            cboSearchField.AddItem "Contact"
            cboSearchField.AddItem "Addr 1"
            cboSearchField.AddItem "City"
            cboSearchField.AddItem "State"
            cboSearchField.AddItem "Zip"
    End Select
    
    cboSearchField.ListIndex = 0
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:LoadSearchFields"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : ClearBatchTab()
' DateTime  : 6/28/2004
' Purpose   : Clears the fields on the Batch tab.
'---------------------------------------------------------------------------------------
'
Private Sub ClearBatchTab()
    lstErrorTransactions.Clear
    txtTotalRecords = ""
    txtNumShipped = ""
    txtNumErrors = ""
End Sub
'---------------------------------------------------------------------------------------
' Procedure : SetMenuButton()
' DateTime  : 7/1/2004
' Purpose   : Enables/disables menu buttons and sets color.
'---------------------------------------------------------------------------------------
'
Public Sub SetMenuButton(Index As Integer, blnEnable As Boolean)
    If frmSetup.chkDisableButton(Index) = 0 And blnEnable Then
        cmdMenu(Index).Enabled = True
        cmdMenu(Index).BackColor = &HC0E0FF
        ' ReLabel button is behind Ship button
        If Index = 7 Then
            cmdMenu(6).Visible = False
        End If
    Else
        cmdMenu(Index).Enabled = False
        cmdMenu(Index).BackColor = &HE0E0E0
        If Index = 7 Then
            cmdMenu(6).Visible = True
        End If
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : ClearHistoryTab()
' DateTime  : 7/27/2004
' Purpose   : Clears the Search Value then updates the grid.
'---------------------------------------------------------------------------------------
'
Private Sub ClearHistoryTab()

    txtSearchValue = ""
    Call UpdateShipmentsGrid(cboShipmentType, cboShipmentStatus)

End Sub
'---------------------------------------------------------------------------------------
' Procedure : SaveAddress
' DateTime  : 8/31/2004
' Purpose   : Add or update Address in AddressBook table
' Call from :
'---------------------------------------------------------------------------------------
'
Public Function SaveAddress(ByVal strCustID As String) As Boolean
    
    On Error GoTo EH
    
    Dim rsAddress As New ADODB.Recordset
    Dim strQuery As String
    
    'If the CustID is empty exit
    If strCustID = "" Then Exit Function
        
    strQuery = "SELECT CustID FROM AddressBook WHERE CustID = " & SingleQuotes(strCustID)
    rsAddress.Open strQuery, g_connFSMSClient, adOpenStatic, adLockOptimistic
    
    If rsAddress.EOF Then
        strQuery = "INSERT INTO AddressBook VALUES ("
        strQuery = strQuery + SingleQuotes(strCustID) + ","
        strQuery = strQuery + SingleQuotes(cboCompany) + ","
        strQuery = strQuery + SingleQuotes(cboContact) + ","
        strQuery = strQuery + SingleQuotes(f13) + ","
        strQuery = strQuery + SingleQuotes(f14) + ","
        strQuery = strQuery + SingleQuotes(f15) + ","
        strQuery = strQuery + SingleQuotes(Left(f16, 2)) + ","
        strQuery = strQuery + SingleQuotes(f17) + ","
        strQuery = strQuery + SingleQuotes(Left(f50, 2)) + ","
        strQuery = strQuery + SingleQuotes(f18) + ","
        strQuery = strQuery + SingleQuotes(Left(f23, 1)) + ","
        strQuery = strQuery + SingleQuotes(f20) + ","
        strQuery = strQuery + SingleQuotes(frmEmail.f1202) + ","
        strQuery = strQuery + Str(f440) + ","
        strQuery = strQuery + SingleQuotes(f1358) + ")"             ' TaxID
        g_connFSMSClient.Execute strQuery
    Else
        strQuery = "UPDATE AddressBook SET [CustID] = " + SingleQuotes(strCustID) + ","
        strQuery = strQuery + "[f11] = " + SingleQuotes(cboCompany) + ","
        strQuery = strQuery + "[f12] = " + SingleQuotes(cboContact) + ","
        strQuery = strQuery + "[f13] = " + SingleQuotes(f13) + ","
        strQuery = strQuery + "[f14] = " + SingleQuotes(f14) + ","
        strQuery = strQuery + "[f15] = " + SingleQuotes(f15) + ","
        strQuery = strQuery + "[f16] = " + SingleQuotes(Left(f16, 2)) + ","
        strQuery = strQuery + "[f17] = " + SingleQuotes(f17) + ","
        strQuery = strQuery + "[f50] = " + SingleQuotes(Left(f50, 2)) + ","
        strQuery = strQuery + "[f18] = " + SingleQuotes(f18) + ","
        strQuery = strQuery + "[f23] = " + SingleQuotes(Left(f23, 1)) + ","
        strQuery = strQuery + "[f20] = " + SingleQuotes(f20) + ","
        strQuery = strQuery + "[f1202] = " + SingleQuotes(frmEmail.f1202) + ","
        strQuery = strQuery + "[f440] = " + Str(f440) + ","
        strQuery = strQuery + "[f118] = " + SingleQuotes(f1358)                      ' TaxID
        strQuery = strQuery + " WHERE CustID = " + SingleQuotes(strCustID)
        g_connFSMSClient.Execute strQuery
    End If
    
    SaveAddress = True
    
Release:

    If rsAddress.State = adStateOpen Then rsAddress.Close
    Set rsAddress = Nothing
    
    Exit Function
EH:
    MsgBox Err.Description, vbCritical, "frmShip:SaveAddress"
    Resume Release
    Resume
End Function
'---------------------------------------------------------------------------------------
' Procedure : LoadPaymentTypeCombo
' DateTime  : 9/15/2004
' Modifed   : 11/12/2004 Added code to save current value
' Purpose   : Loads the payment types for Ground/FHD or Express
' Call from : f1274_Click
'---------------------------------------------------------------------------------------
'
Private Sub LoadPaymentTypeCombo(ByVal strCurrentValue As String)
    
    On Error GoTo EH
    
    Dim i As Integer
    
    f23.Clear
    If Left(f1274, 2) = "92" Or Left(f1274, 2) = "90" Then
        f23.AddItem "1 - Prepaid"
        f23.AddItem "2 - Collect (Not COD)"
        f23.AddItem "3 - Bill 3rd Party"
        f23.AddItem "5 - Bill Recipient"
    Else
        f23.AddItem "1 - Bill Shipper"
        f23.AddItem "2 - Bill Recipient"
        f23.AddItem "3 - Bill 3rd Party"
    End If
    
    For i = 0 To f23.ListCount - 1
        If Left(strCurrentValue, 1) = Left(f23.List(i), 1) Then
            f23 = strCurrentValue
            Exit For
        End If
    Next
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:LoadPaymentTypeCombo"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : LoadIORCombo
' DateTime  : 10/28/2004
' Purpose   : Loads the Open IPD Facilities for the current account
' Call from : chkIPD_Click
'---------------------------------------------------------------------------------------
'
Public Sub LoadIORCombo(ByVal strAcctNum As String, ByVal strShipDate As String)
    
    Dim rsIOR As New ADODB.Recordset
    Dim strQuery As String
    
    On Error GoTo EH
    
    strQuery = "SELECT DISTINCT g_str1355 FROM IPD WHERE g_str10 = " & SingleQuotes(strAcctNum)
    strQuery = strQuery + " And g_str24 =  " + SingleQuotes(Format(strShipDate, "YYYYMMDD"))
    strQuery = strQuery + " And IPDStatus = 'Open'"
    
    rsIOR.Open strQuery, g_connFSMSClient, adOpenStatic, adLockOptimistic
    f1355.Clear
    Do Until rsIOR.EOF
        f1355.AddItem rsIOR.Fields(0)
        rsIOR.MoveNext
    Loop
    f1355.ListIndex = IIf(f1355.ListCount > 0, 0, -1)
    
Release:
    If rsIOR.State = adStateOpen Then rsIOR.Close
    Set rsIOR = Nothing
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:LoadIORCombo"
    Resume Release

    
End Sub
'---------------------------------------------------------------------------------------
' Procedure : ShowImportForm
' DateTime  : 4/8/2005
' Purpose   : Used to Show the Import form and set the option button for SmartPost or
'           : non-SmartPost imports.
' Call from :
'---------------------------------------------------------------------------------------
'
Private Sub ShowImportForm(ByVal blnSP As Boolean)

    With frmImport
        .Show vbModeless, Me
        If blnSP Then
            .optAppend.Enabled = False
            .optOverwrite.Value = True
            .optOverwrite.Enabled = False
        Else
            .optAppend.Enabled = True
            .optAppend.Value = True
            .optOverwrite.Enabled = True
        End If
    End With

End Sub
'---------------------------------------------------------------------------------------
' Procedure : DisableNonSPFields
' DateTime  : 4/27/2005
' Purpose   : Used to disable/enable Ship fields not used in SP and SP+
' Call from : ShowSpecialSvcs
'---------------------------------------------------------------------------------------
'
Private Sub DisableNonSPFields(ByVal blnDisable As Boolean)

    On Error GoTo EH
    
    f50.Enabled = IIf(blnDisable, False, True)              'Country
    Label1(2).Enabled = IIf(blnDisable, False, True)        'Country label
    f440.Enabled = IIf(blnDisable, False, True)             'Residential
    If blnDisable Then
        lblPONumber.Caption = IIf(blnDisable, "Billing Number:", "P.O. Number:")       'P.O. Label
    End If
    f1273.Enabled = IIf(blnDisable, False, True)            'Package Type
    Label1(20).Enabled = IIf(blnDisable, False, True)       'Package Type Label
    f26.Enabled = IIf(blnDisable, False, True)              'Declared Value
    Call BeforeGotFocus(frmShip, frmShip.f26)
    lblDecVal.Enabled = IIf(blnDisable, False, True)        'Dec Val label
    f68.Enabled = IIf(blnDisable, False, True)              'Rate Currency
    f23.Enabled = IIf(blnDisable, False, True)              'Pay Type
    Label1(19).Enabled = IIf(blnDisable, False, True)       'Pay Type Label
    f20.Enabled = IIf(blnDisable, False, True)              'Pay acct#
    lblf20(0).Enabled = IIf(blnDisable, False, True)        'Pay acct# label
    mnuQuote.Enabled = IIf(blnDisable, False, True)         'Service Quote on menu
    With frmMPS
        .f26.Enabled = IIf(blnDisable, False, True)         'Declared Value
        Call BeforeGotFocus(frmMPS, frmMPS.f26)
        .Label14(0).Enabled = IIf(blnDisable, False, True)  'Dec Val label
        .f3057.Enabled = IIf(blnDisable, False, True)       'Inv #
        .Label25.Enabled = IIf(blnDisable, False, True)     'Inv # Label
        .Label35.Caption = IIf(blnDisable, "Billing Number:", "P.O. Number:")     'PO#
        .f3018.Enabled = IIf(blnDisable, False, True)       'Non-Std pkg
        '03/16/06 Added these fields
        .f1208.Enabled = IIf(blnDisable, False, True)               'Sig Svcs
        .cmdViewSigReq.Enabled = IIf(blnDisable, False, True)       'View/Edit button
    End With

    Exit Sub

EH:
    MsgBox Err.Description, vbCritical, "frmShip:LoadPostalClassCombo"

End Sub


Public Function History() As ADODB.Recordset       'Shipping History recordset

    Set History = m_rsHistory

End Function

'---------------------------------------------------------------------------------------
' Procedure : LoadPostalClassCombo()
' DateTime  : 4/29/2005
' Purpose   : Loads the Class combo based on the classes selected on Setup form
'             SmartPost tab.
' Call from :
'---------------------------------------------------------------------------------------
'
Public Sub LoadPostalClassCombo()

    On Error GoTo EH
    
    With frmSetup
        cboClass.Clear
        If .chkAllowStdA Then cboClass.AddItem "A - Std A"
        If .chkAllowStdB Then cboClass.AddItem "B - Std B"
        If .chkAllowPM Then cboClass.AddItem "F - Priority Mail"
    End With
    '20070808-03 If only one item in list select it
    If cboClass.ListCount = 1 Then cboClass.ListIndex = 0

    Exit Sub

EH:
    MsgBox Err.Description, vbCritical, "frmShip:LoadPostalClassCombo"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : LoadPostalSubClassCombo()
' DateTime  : 20070808-02
' Purpose   : Loads the Sub-Class combo based on the sub-classes selected on Setup form
'             SmartPost tab.
' Call from :
'---------------------------------------------------------------------------------------
'
Public Sub LoadPostalSubClassCombo()

    On Error GoTo EH
    
    cboSubClass.Clear
    cboSubClass.AddItem "P - Parcel Post"
    With frmSetup
        If .chkAllowBPM Then cboSubClass.AddItem "B - Bound Printed Matter"
        If .chkAllowMM Then cboSubClass.AddItem "M - Media Mail"
    End With
    'If only one item in list select it
    If cboSubClass.ListCount = 1 Then cboSubClass.ListIndex = 0
    
    Exit Sub

EH:
    MsgBox Err.Description, vbCritical, "frmShip:LoadPostalSubClassCombo"

End Sub

'---------------------------------------------------------------------------------------
' Module    : CommodCheck
' DateTime  : 5/5/2005
' Author    : Chris Elwell
' Purpose   : Checks for required SP fields
'---------------------------------------------------------------------------------------
'
Private Function CommodCheck() As String
    
    On Error GoTo EH
    
    Dim strMessages As String
    
    If f79 = "" Then
        strMessages = "Description Required" & vbCrLf
    End If
    If f82 = "" Then
        strMessages = strMessages + "Number of Units Required" & vbCrLf
    End If
    If f414 = "" Then
        strMessages = strMessages + "Unit of Measure Required" & vbCrLf
    End If
    If f1030 = "" Then
        strMessages = strMessages + "Unit Value Required" & vbCrLf
    End If
    If f78 = "" Then
        strMessages = strMessages + "Customs Value Required" & vbCrLf
    End If
'    If f77 = "" Then
'        strMessages = strMessages + "Commodity Wgt Required" & vbCrLf
'    End If
    If f80(0) = "" Then
        strMessages = strMessages + "Country of Manu Required" & vbCrLf
    End If
'   2009-02-05, JFW, Not required, All Seating.
'    If f81 = "" Then
'        strMessages = strMessages + "Harmonized Code Required" & vbCrLf
'    End If
    
    If chkIntlIPD.Value = 1 Or chkIPD.Value = 1 Then
        If f81 = "" Then
            strMessages = strMessages + "Harmonized Code Required for IPD" & vbCrLf
        End If
    End If
        
    If Not g_frmCommodityMore Is Nothing Then
        If g_frmCommodityMore.cboDocument1.Text & "" <> "" _
        Or g_frmCommodityMore.cboDocument2.Text & "" <> "" _
        Or g_frmCommodityMore.cboDocument3.Text & "" <> "" Then
            If f1275.Text = "" _
            Or f120.Text = "" Then
                strMessages = strMessages + "Customs docs require Part and Marks" & vbCrLf
            End If
        End If
    End If
    
ExitHere:
    CommodCheck = strMessages
    Exit Function
EH:
    strMessages = Err.Description
    MsgBox strMessages, vbCritical, "frmShip:CommodCheck"
    Resume ExitHere
    
End Function

'---------------------------------------------------------------------------------------
' Procedure : MPSButtonEnable
' DateTime  : 6/7/2005
' Purpose   : Looks at all factors affecting whether cmdMPS should be enabled or disabled
' Call from : f1_Change, optCommodities_Click, cboCustID_Change, chkDuplicate_Click, chkIPD_Click
'---------------------------------------------------------------------------------------
'
Public Function MPSButtonEnable() As Boolean

    ' Debug.Assert (g_blnIPD And chkIntlIPD.Value = 1) Or (Not g_blnIPD And chkIntlIPD.Value = 0)
    
    '04/18/06 - Removed the country code check
    If (f1 <> "" Or cboCustID <> "") And _
       (Not g_blnIPD Or frmSetup.chkIPDMPS = 1) And _
       chkDuplicate = 0 Then
       
            MPSButtonEnable = True
    
    Else
            
            MPSButtonEnable = False
    
    End If

End Function
'---------------------------------------------------------------------------------------
' Module    : OnlineReturnReply
' DateTime  : 6/29/2005
' Author    : Chris Elwell
' Purpose   : Handle Online return reply
' Call from : g_clsParser_ParseComplete()
'---------------------------------------------------------------------------------------
'
Private Sub OnlineReturnReply(ByVal strTrkNum As String)
    
    On Error GoTo EH
    
    If g_str3 = "" Then
        Call SaveReturnLabel(strTrkNum, "Online")
        '20070905-01 Added code to save Address
        If cboCustID.Visible = True And chkAddAddress = 1 Then
            Call SaveAddress(cboCustID)
            Call LoadAddrLookupCombos(cboCustID, cboCustID, "CustID")
            Call LoadAddrLookupCombos(cboContact, cboContact, "f12")
            Call LoadAddrLookupCombos(cboCompany, cboCompany, "f11")
        End If
        'Clear only if not doing MPS or Duplicates
        If frmReturnLbl.chkNoShipLabel = 0 And g_str116 = 1 Then
            Call frmReturnLbl.ClearOnlineTab
            Call ClearShipFields
            Call ClearGlobalVars
        End If
        StatusBar1.Panels(2) = "Online Return Label Generated"
        Call WriteReturnReply
    Else
        MsgBox g_str3, vbExclamation, "Online Return Label Error"
        StatusBar1.Panels(2) = "Online Return Label Error"
    End If
    
    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:OnlineReturnReply"

End Sub
'---------------------------------------------------------------------------------------
' Module    : ReturnReply
' DateTime  : 6/29/2005
' Author    : Chris Elwell
' Purpose   : Handles regular return reply
' Call from : g_clsParser_ParseComplete()
'---------------------------------------------------------------------------------------
'
Private Sub ReturnReply(ByVal strTrkNum As String)
    
    On Error GoTo EH
    
    Dim strLabelText As String
    
    If g_str3 = "" Then
        Call SaveReturnLabel(strTrkNum, "Label")
        '10/28/05 moved up to here global vars aren't cleared before writing reply
        Call WriteReturnReply
        'Added 10/28/05 for custom labels
        If frmSetup.chkCustomLabels = 1 Then
            Call CreateCustomLabel
        End If
        
        Call PDFlabelAdd(strTrkNum)
        
        '20070905-01 Added code to save Address
        If cboCustID.Visible = True And chkAddAddress = 1 Then
            Call SaveAddress(cboCustID)
            Call LoadAddrLookupCombos(cboCustID, cboCustID, "CustID")
            Call LoadAddrLookupCombos(cboContact, cboContact, "f12")
            Call LoadAddrLookupCombos(cboCompany, cboCompany, "f11")
        End If
        'Clear only if not doing MPS or Duplicates
        If frmReturnLbl.chkNoShipLabel = 0 _
        And (g_str116 = "" Or g_str116 = "1") _
        And frmMPS.chkPrintAsAdd = 0 Then
            Call ClearShipFields
            Call ClearGlobalVars
        End If
        StatusBar1.Panels(2) = "Return Label Generated"
    Else
        MsgBox g_str3, vbExclamation, "Return Label Error"
        StatusBar1.Panels(2) = "Return Label Error"
    End If
    
    '10/28/05 added to control flow when batch processing w/returns
    g_blnBatchReturn = False
    
    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:ReturnReply"
    If False Then
        Resume
    End If
    
End Sub
'---------------------------------------------------------------------------------------
' Module    : SaveReturnLabel
' DateTime  : 6/29/2005
' Author    : Chris Elwell
' Purpose   : Store shipment fields to database
'---------------------------------------------------------------------------------------
'
Private Sub SaveReturnLabel(ByVal strTrkNum As String, ByVal strType As String)
    
    On Error GoTo EH
    
    Dim strInsertQuery As String
    
    '20070509-02 Exit Sub if Trk# is empty
    If strTrkNum = "" Then Exit Sub
    
    'Date created
    If IsDate(g_str24) Then g_str24 = Format(g_str24, "YYYYMMDD")
    If g_str24 = "" Then g_str24 = Format(Date, "YYYYMMDD")
    
    strInsertQuery = "INSERT INTO Returns ( "
    strInsertQuery = strInsertQuery + "[g_str29], [g_str1], [g_str25], [g_str3056], [g_str3057], [g_str1398], [g_str2210], [g_str11], [g_str12], [g_str13], [g_str15], [g_str16], [g_str17], [g_str50], [g_str10], [g_str1274], [g_str24], [g_str2392], [Type], [Status], [ProcessTime], [LocationName], [Transaction]"
    strInsertQuery = strInsertQuery + " ) VALUES ( "
    strInsertQuery = strInsertQuery + SingleQuotes(strTrkNum) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(f1) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str25) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str3056) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str3057) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str1398) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str2210) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str11, 35)) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str12, 35)) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str13, 35)) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str15, 35)) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str16, 14)) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str17, 10)) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str50) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str10) + ","
    ' g_str1274Return
    strInsertQuery = strInsertQuery + SingleQuotes(g_str1274Return) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str24) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str2392) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(strType) + ","
    strInsertQuery = strInsertQuery + "'Shipped',"
    
    If GetClientDatabaseType = "Access" Then
        strInsertQuery = strInsertQuery + "#" + CStr(Now) + "#, "
    Else
        strInsertQuery = strInsertQuery + "'" + CStr(Now) + "', "
    End If
    strInsertQuery = strInsertQuery + SingleQuotes(frmShip.cboLocationName(0)) + ", "
    strInsertQuery = strInsertQuery + SingleQuotes(Left(g_strRepeatTrans, 512)) + " )"
   
    DebugPrint strInsertQuery
    
    g_connFSMSClient.Execute strInsertQuery

    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:SaveReturnLabel"

End Sub
'---------------------------------------------------------------------------------------
' Module    : SaveLTLReply
' DateTime  : 1/11/2006
' Author    : Chris Elwell
' Purpose   : Store LTL fields to database
'---------------------------------------------------------------------------------------
'
Private Sub SaveLTLReply()
    
    On Error GoTo EH
    
    Dim strQuery As String
    Dim rsLTL As New ADODB.Recordset
    
    strQuery = "SELECT f3056, f4683 FROM LTLMulti WHERE f1 = " & SingleQuotes(g_str1)
    strQuery = strQuery + " AND Workstation = '" & g_strComputerName & "'"
    
    rsLTL.Open strQuery, g_connFSMSClient, adOpenKeyset, adLockOptimistic
    
        'Date created
    If IsDate(g_str24) Then g_str24 = Format(g_str24, "YYYYMMDD")
    If g_str24 = "" Then g_str24 = Format(Date, "YYYYMMDD")

    Do Until rsLTL.EOF
    
        strQuery = "INSERT INTO LTLShipments VALUES("
        strQuery = strQuery + SingleQuotes(f1) + ","
        strQuery = strQuery + SingleQuotes(g_str1222) + ","
        strQuery = strQuery + SingleQuotes(rsLTL!f3056) + ","
        strQuery = strQuery + SingleQuotes(rsLTL!f4683) + ","
        strQuery = strQuery + SingleQuotes(Left(g_str11, 35)) + ","
        strQuery = strQuery + SingleQuotes(Left(g_str12, 35)) + ","
        strQuery = strQuery + SingleQuotes(Left(g_str13, 35)) + ","
        strQuery = strQuery + SingleQuotes(Left(g_str15, 35)) + ","
        strQuery = strQuery + SingleQuotes(Left(g_str16, 14)) + ","
        strQuery = strQuery + SingleQuotes(Left(g_str17, 10)) + ","
        strQuery = strQuery + SingleQuotes(g_str50) + ","
        strQuery = strQuery + SingleQuotes(g_str10) + ","
        strQuery = strQuery + SingleQuotes(g_str24) + ","
        strQuery = strQuery + "'Shipped',"
        
        If GetClientDatabaseType = "Access" Then
            strQuery = strQuery + "#" + CStr(Now) + "#)"
        Else
            strQuery = strQuery + "'" + CStr(Now) + "')"
        End If
    
        g_connFSMSClient.Execute strQuery
        
        rsLTL.MoveNext
    
    Loop
    
Release:
    If rsLTL.State = adStateOpen Then rsLTL.Close
    Set rsLTL = Nothing
    
Exit Sub

EH:
    MsgBox Err.Description, vbCritical, "frmShip:SaveLTLReply"
    Resume Release
    
End Sub
'---------------------------------------------------------------------------------------
' Module    : SaveTagReply
' DateTime  : 1/26/2006
' Author    : Chris Elwell
' Purpose   : Store Tag fields to database
'---------------------------------------------------------------------------------------
'
Private Sub SaveTagReply(ByVal strType As String)
    
    On Error GoTo EH
    
    Dim strInsertQuery As String
    
    'Call Tag # is first trk#
    If strType = "CT" Then g_str29 = g_str1011
    
    strInsertQuery = "INSERT INTO Tags VALUES("
    strInsertQuery = strInsertQuery + SingleQuotes(g_str1011) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str1012) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str29) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str1365) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str2210) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str25) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str10) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str498) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str11, 35)) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str12, 35)) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str13, 35)) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str15, 35)) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str16, 14)) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(Left(g_str17, 10)) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(g_str50) + ","
    strInsertQuery = strInsertQuery + SingleQuotes(strType) + ","
    strInsertQuery = strInsertQuery + "'Scheduled')"
    
    g_connFSMSClient.Execute strInsertQuery

    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:SaveTagReply"

End Sub
'---------------------------------------------------------------------------------------
' Module    : SaveCancelTagReply
' DateTime  : 1/26/2006
' Author    : Chris Elwell
' Purpose   : Update Tag status in database
'---------------------------------------------------------------------------------------
'
Private Sub SaveCancelTagReply(ByVal str1011 As String, ByVal str29 As String)
    
    On Error GoTo EH
    
    Dim strQuery As String
    
    
    strQuery = "UPDATE Tags SET [Status] = 'Canceled' WHERE f1011 = " & SingleQuotes(str1011)
    strQuery = strQuery & " AND f29 = " & SingleQuotes(str29)
    g_connFSMSClient.Execute strQuery

    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:SaveCancelTagReply"

End Sub
'---------------------------------------------------------------------------------------
' Module    : CheckForReturns
' DateTime  : 7/15/2005
' Modifed   : 10/25/05 Added ShipDate to Returns query in case order was shipped on previous date
'             and had a return on that date.
' Author    : Chris Elwell
' Purpose   : Called from DeleteReply. Checks to see if there's a return label with the
'             same OrderID as the deleted trk#. If so show a message asking the user if
'             they want to delete the return label.
'---------------------------------------------------------------------------------------
'
Private Sub CheckForReturns(ByVal str29 As String)
    
    On Error GoTo EH
    
    Dim strQuery As String
    Dim rs As New ADODB.Recordset
    Dim lngAnswer As Long
    Dim str1 As String
    
    'Get the OrderID from the Shipments table
    strQuery = "SELECT g_str1 FROM Shipments WHERE g_str29 = " & SingleQuotes(str29)
    rs.Open strQuery, g_connFSMSClient, adOpenKeyset, adLockOptimistic
    
    If Not rs.EOF Then
        str1 = rs!g_str1
        
        '11/05/05 Added to exit if there's no order ID
        If str1 = "" Then GoTo Release
        
        'Close the first recordset
        rs.Close
        strQuery = "SELECT g_str29 FROM Returns WHERE g_str1 = " & SingleQuotes(str1)
        strQuery = strQuery & " AND Status = 'Shipped' AND g_str24 = '" & Format(txtShipDate, "YYYYMMDD") & "'"
        rs.Open strQuery, g_connFSMSClient, adOpenKeyset, adLockOptimistic
        
        If Not rs.EOF Then
            lngAnswer = MsgBox("Do you want to delete the return label(s) associated with this order?", vbYesNo, "Return Label Delete")
            If lngAnswer = vbYes Then
                'Boolean used to indicate this is a return trk# being deleted so the
                'Returns table gets updated
                g_blnReturnDelete = True
                '10/11/05 Added to clear global reply buffer var
                g_strReply = ""
                
                Do Until rs.EOF
                    'Set to false to control flow
                    g_blnComplete = False
                    Call SendData(BuildDeleteTrans(rs!g_str29))
                    
                    'Wait until transaction reply has been parsed and writebacks completed
                    Do Until g_blnComplete
                        DoEvents
                    Loop
                    rs.MoveNext
                Loop
                'Finished deleting returns
                g_blnReturnDelete = False
            End If
        End If
    End If

Release:

    If rs.State = adStateOpen Then rs.Close
    Set rs = Nothing
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:CheckForReturns"
    Resume Release

End Sub
'---------------------------------------------------------------------------------------
' Procedure : SetCommodSummary()
' DateTime  : 9/2/2005
' Purpose   : Set the Commodity Count, the Total Customs Value, and Total Commodity Wgt.
'---------------------------------------------------------------------------------------
'
Public Sub SetCommodSummary()

    On Error GoTo EH

    Dim rsCommod As New ADODB.Recordset
    Dim strQuery As String
    Dim i As Integer
    Dim sglCustValTotal As Single
    Dim sglCommodWgtTotal As Single
    Dim str1 As String
    
'    f1.Enabled = False
'    cboCustID.Enabled = False
    
    str1 = IIf(f1.Visible, f1, cboCustID)

    strQuery = "SELECT g_str77, g_str78 FROM IntlCommodities WHERE f1 = " & SingleQuotes(str1)
    strQuery = strQuery & " AND Workstation = '" & g_strComputerName & "'"
    strQuery = strQuery & " AND (g_str29 IS NULL OR g_str29 = '')"

    rsCommod.Open strQuery, g_connFSMSClient, adOpenStatic, adLockOptimistic
    
    If rsCommod.EOF Then
        txtCommodCount = ""
        txtTotCustVal = ""
        txtTotCommodWgt = ""
    Else
        sglCustValTotal = 0
        sglCommodWgtTotal = 0
        
        Do Until rsCommod.EOF
            If IsNumeric(rsCommod("g_str78")) Then
                sglCustValTotal = sglCustValTotal + Val(rsCommod("g_str78"))
            End If
            If IsNumeric(rsCommod("g_str77")) Then
                sglCommodWgtTotal = sglCommodWgtTotal + Val(rsCommod("g_str77"))
            End If
            rsCommod.MoveNext
        Loop
        
        txtCommodCount = Str(rsCommod.RecordCount)
        txtTotCustVal = Format(Str(sglCustValTotal), "#.00")
        txtTotCommodWgt = Format(Str(sglCommodWgtTotal), "#.00")
        
    End If

Release:
    If rsCommod.State = adStateOpen Then rsCommod.Close
    Set rsCommod = Nothing
    
    Exit Sub
EH:
    MsgBox Err.Description, vbCritical, "frmShip:SetCommodSummary"
    Resume Release

End Sub
'---------------------------------------------------------------------------------------
' Procedure : EnableDisableIPD()
' DateTime  : 12/22/2005
' Purpose   : Enables/disables IPD fields based on boolean passed
'---------------------------------------------------------------------------------------
'
Public Sub EnableDisableIPD(ByVal bEnable As Boolean)
    On Error GoTo EH
    
    If bEnable Then
        If Not IsDate(f24.Text) Then
            bEnable = False
        ElseIf CDate(f24.Text) < Date Then
            bEnable = False
        ElseIf Not g_blnFormLoadComplete Then
            bEnable = False
        Else
            Call g_frmIPD.AutoOpen(CDate(f24.Text))
        End If
        If Not bEnable Then
            chkIntlIPD.Value = 0
        End If
    End If
        
    If bEnable Then
        optCommodities.Value = True
        lbl1355.Visible = True
        f1355.Visible = True
        Call LoadIORCombo(frmSetup.f10, f24)
        g_blnIPD = True
        chkDuplicate = 0
        chkDuplicate.Enabled = False
        chkDuplicate.Visible = chkDuplicate.Enabled
        f1174(0).Enabled = False
        cmdViewBSO(0).Enabled = False
        f70.Enabled = False
        f71.Enabled = False
        f72.Enabled = False
        f1358.Enabled = False
        lbl1358.Enabled = False
        lblCI(0).Enabled = False
        lblf20(1).Enabled = False
        Label1(23).Enabled = False
        cbo1358.Enabled = False
        opt1358(0).Enabled = False
        opt1358(1).Enabled = False
        Call LoadServices("18")
        
        Call g_frmIPD.Hide
        
    Else
        lbl1355.Visible = False
        f1355.Visible = False
        g_blnIPD = False
        chkDuplicate.Enabled = True
        chkDuplicate.Visible = chkDuplicate.Enabled
        f1174(0).Enabled = True
        cmdViewBSO(0).Enabled = True
        f70.Enabled = True
        f71.Enabled = True
        f72.Enabled = True
        cbo1358.Enabled = True
        opt1358(0).Enabled = True
        opt1358(1).Enabled = True
        If opt1358(1) Then
            f1358.Visible = True
            f1358.Enabled = True
        End If
        lbl1358.Enabled = True
        lblCI(0).Enabled = True
        lblf20(1).Enabled = True
        Label1(23).Enabled = True
        
        If Left(f1274.Text, 2) = "18" Then
            f1274.Text = "01"
            If f1274.ListIndex = -1 Then f1274.Text = ""
        End If
    
        Call DomIntlScreenLayout
        Call LoadServices(Left(f1274, 2))
        
        Call LoadPackaging(Left(f1273, 2))
        Call ShowSpecialSvcs
    
    End If
    
    'Added 6/7 - MPSButtonEnable looks at all factors to determine if it can be enabled
    cmdMPS.Enabled = MPSButtonEnable

    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:EnableDisableIPD"
    If False Then
        Resume
    End If
    
End Sub
'---------------------------------------------------------------------------------------
' Module    : LTLReply
' DateTime  : 01/11/2006
' Author    : Chris Elwell
' Purpose   : Handles LTL reply
' Call from : g_clsParser_ParseComplete()
'---------------------------------------------------------------------------------------
'
Private Sub LTLReply()
    
    On Error GoTo EH
    
    If g_str3 = "" Then
        Call SaveLTLReply
        '20070315-01 added for custom labels
        If frmSetup.chkCustomLabels = 1 Then
            Call CreateCustomLabel
        End If
        Call WriteBOLReply
        Call frmBOL.DeleteLTLMulti(g_str1)
        '20070905-01 Added code to save Address
        If cboCustID.Visible = True And chkAddAddress = 1 Then
            Call SaveAddress(cboCustID)
            Call LoadAddrLookupCombos(cboCustID, cboCustID, "CustID")
            Call LoadAddrLookupCombos(cboContact, cboContact, "f12")
            Call LoadAddrLookupCombos(cboCompany, cboCompany, "f11")
        End If
        Call ClearShipFields
        Call ClearGlobalVars
        StatusBar1.Panels(2) = "LTL BOL Created"
    Else
        MsgBox g_str3, vbExclamation, "LTL BOL Error"
        StatusBar1.Panels(2) = "LTL BOL Error"
    End If
    
    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:LTLReply"

End Sub
'---------------------------------------------------------------------------------------
' Module    : TagReply
' DateTime  : 01/26/2006
' Author    : Chris Elwell
' Purpose   : Handles Call Tag and Express Tag replies
' Call from : g_clsParser_ParseComplete()
'---------------------------------------------------------------------------------------
'
Private Sub TagReply()
    
    On Error GoTo EH
    
    If g_str3 = "" Then
        Call SaveTagReply(g_strTagType)
        Call WriteTagReply
        With frmAddTags
            Call .ClearSearchFields
            Call .UpdateTagsGrid(.cboType, .cboStatus, .f1365, .cboSearchField, .txtSearchValue)
            Call .DeleteTagsMulti(g_str1)
            Call .ClearTagFields
        End With
        '20070905-01 Added code to save Address
        If cboCustID.Visible = True And chkAddAddress = 1 Then
            Call SaveAddress(cboCustID)
            Call LoadAddrLookupCombos(cboCustID, cboCustID, "CustID")
            Call LoadAddrLookupCombos(cboContact, cboContact, "f12")
            Call LoadAddrLookupCombos(cboCompany, cboCompany, "f11")
        End If
        Call ClearShipFields
        Call ClearGlobalVars
        If g_strTagType = "CT" Then
            StatusBar1.Panels(2) = "Call Tag Created"
        ElseIf g_strTagType = "ET" Then
            StatusBar1.Panels(2) = "Express Tag Created"
        End If
        With frmAddTags
            .SetFocus
            .f1365_2 = .f1365
            .SSTab1.Tab = 1
        End With
    Else
        If g_strTagType = "CT" Then
            MsgBox g_str3, vbExclamation, "Call Tag Error"
            StatusBar1.Panels(2) = "Call Tag Error"
        ElseIf g_strTagType = "ET" Then
            MsgBox g_str3, vbExclamation, "Express Tag Error"
            StatusBar1.Panels(2) = "Express Tag Error"
        End If
        With frmAddTags
            .SetFocus
            .SSTab1.Tab = 0
        End With
    End If
    
    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:TagReply"

End Sub
'---------------------------------------------------------------------------------------
' Module    : TagCancelReply
' DateTime  : 01/26/2006
' Author    : Chris Elwell
' Purpose   : Handles Call Tag and Express Tag Cancel replies
' Call from : g_clsParser_ParseComplete()
'---------------------------------------------------------------------------------------
'
Private Sub TagCancelReply()
    
    On Error GoTo EH
    
    If g_str3 = "" Then
        Call SaveCancelTagReply(g_str1, g_str1010)  'g_str1 holds the dispatch#, g_str1010 holds the trk#
        Call WriteCancelTagReply
        With frmAddTags
            Call .ClearSearchFields
            Call .UpdateTagsGrid(.cboType, .cboStatus, .f1365_2)
        End With
        If g_strTagType = "CT" Then
            StatusBar1.Panels(2) = "Call Tag Canceled"
        ElseIf g_strTagType = "ET" Then
            StatusBar1.Panels(2) = "Express Tag Canceled"
        End If
    Else
        If g_strTagType = "CT" Then
            MsgBox g_str3, vbExclamation, "Call Tag Cancel Error"
            StatusBar1.Panels(2) = "Call Tag Cancel Error"
        ElseIf g_strTagType = "ET" Then
            MsgBox g_str3, vbExclamation, "Express Tag Cancel Error"
            StatusBar1.Panels(2) = "Express Tag Cancel Error"
        End If
    End If
    
    Exit Sub
EH:
     MsgBox Err.Description, vbCritical, "frmShip:TagCancelReply"

End Sub
'---------------------------------------------------------------------------------------
' Module    : GotFocus - textboxes
' DateTime  : 8/29/2005
' Author    : Chris Elwell
' Purpose   : The subroutines below call a routine to select all text in the text box
'             passed to the sub.
'---------------------------------------------------------------------------------------
'
'Order ID
Private Sub f1_GotFocus()
    Call SelectAllText(f1)
End Sub
'Contact Name
Private Sub f12_GotFocus()
    Call SelectAllText(f12)
End Sub
'Company Name
Private Sub f11_GotFocus()
    Call SelectAllText(f11)
End Sub
'Address 1
Private Sub f13_GotFocus()
    Call SelectAllText(f13)
End Sub
'Address 2
Private Sub f14_GotFocus()
    Call SelectAllText(f14)
End Sub
'City
Private Sub f15_GotFocus()
    'Call SelectAllText(f15)
End Sub
'Zip
Private Sub f17_GotFocus()
    Call SelectAllText(f17)
End Sub
'Phone
Private Sub f18_GotFocus()
    Call SelectAllText(f18)
End Sub
'References
Private Sub f25_GotFocus()
    Call SelectAllText(f25)
End Sub
'PO Number
Private Sub f3056_GotFocus()
    Call SelectAllText(f3056)
End Sub
'Inv Number
Private Sub f3057_GotFocus()
    Call SelectAllText(f3057)
End Sub
'# of Pkgs
Private Sub f116_GotFocus()
    Call SelectAllText(f116)
End Sub
'Dim
Private Sub f57_GotFocus()
    Call SelectAllText(f57)
End Sub
'Dim
Private Sub f58_GotFocus()
    Call SelectAllText(f58)
End Sub
'Dim
Private Sub f59_GotFocus()
    Call SelectAllText(f59)
End Sub
'ShipDate
Private Sub f24_GotFocus()
    Call SelectAllText(f24)
End Sub
'Del Date for optimization
Private Sub txtDelDate_GotFocus()
    Call SelectAllText(txtDelDate)
End Sub
'Dec Val
Private Sub f26_GotFocus()
    Call SelectAllText(f26)
End Sub
'Bill-to Acct#
Private Sub f20_GotFocus()
    Call SelectAllText(f20)
End Sub
'Duty/Tax Acct#
Private Sub f71_GotFocus()
    Call SelectAllText(f71)
End Sub
'Commodity Description
Private Sub f79_GotFocus()
    Call SelectAllText(f79)
End Sub
'Commodity Num of Units
Private Sub f82_GotFocus()
    Call SelectAllText(f82)
End Sub
'Commodity Unit Value
Private Sub f1030_GotFocus()
    Call SelectAllText(f1030)
End Sub
'Commodity Customs Value
Private Sub f78_GotFocus()
    Call SelectAllText(f78)
End Sub
'Commodity Wgt Total
Private Sub f77_GotFocus()
    Call SelectAllText(f77)
End Sub
'Commodity Wgt Each
Private Sub txtCommodityWgt_GotFocus()
    Call SelectAllText(txtCommodityWgt)
End Sub
'Commodity Harmonized Code
Private Sub f81_GotFocus()
    Call SelectAllText(f81)
End Sub
'Commodity Part Number
Private Sub f1275_GotFocus()
    Call SelectAllText(f1275)
End Sub
'Export License #
Private Sub f83_GotFocus()
    Call SelectAllText(f83)
End Sub
'Export License Expiration Date
Private Sub f84_GotFocus()
    Call SelectAllText(f84)
End Sub
'ITN/ITSR/FTSR
Private Sub f1358_GotFocus()
    Call SelectAllText(f1358)
End Sub
'Freight Chg
Private Sub f532_GotFocus()
    Call SelectAllText(f532)
End Sub
'Insurance Chg
Private Sub f533_GotFocus()
    Call SelectAllText(f533)
End Sub
'Misc Charge
Private Sub f534_GotFocus()
    Call SelectAllText(f534)
End Sub
'CI Comments 1 - 3
Private Sub f418_GotFocus(Index As Integer)
    Call SelectAllText(f418(Index))
End Sub
'Batch filename
Private Sub txtBatchFilename_GotFocus()
    Call SelectAllText(txtBatchFilename)
End Sub
'Shipping History Ship Date
Private Sub txtShipDate_GotFocus()
    Call SelectAllText(txtShipDate)
End Sub
'Shipping History Search Value
Private Sub txtSearchValue_GotFocus()
    Call SelectAllText(txtSearchValue)
End Sub
'---------------------------------------------------------------------------------------
'End of GotFocus event subs
'---------------------------------------------------------------------------------------








